V0 can't import phaser

While deploy:

Attempted import error: 'phaser' does not contain a default export (imported as 'Phaser').

23:35:34.424

In v0 console:

Error: Failed to load "https://esm.sh/phaser" from "blob:https://kzmpsnlxb2hqoij7q0kh.lite.vusercontent.net/127a91d5-fdfc-4aa1-a8dd-708ec22a08f5 - see network log for details.", make sure it exists.

So v0 can’t import phaser by itself.

Hi, @detoc1! Welcome to the Vercel Community :smile:

Could you share your v0 chat? Would love to see your prompts to understand the issue further.

I tried giving this a go myself, but full disclaimer - I don’t know much about Phaser. :sweat_smile:

FWIW, the error:

Error: Failed to load "https://esm.sh/phaser" from "blob:https://kzmpsnlxb2hqoij7q0kh.lite.vusercontent.net/127a91d5-fdfc-4aa1-a8dd-708ec22a08f5 - see network log for details.", make sure it exists.

indicates that v0 had difficulties importing Phaser as a module. To work around this limitation, I used an alternative approach by including Phaser via a CDN in a custom Document file. This method allows us to use Phaser in our project without relying on v0’s ability to import it directly.

Let us know how you get on!