hywax / phaser-font-plugin

Phaser 3 plugin to load fonts
MIT License
1 stars 0 forks source link

[BUG] 'phaser' does not contain a default export (imported as 'i') #9

Open dievardump opened 1 month ago

dievardump commented 1 month ago

Version

0.1.1

Describe the problem

I'm trying to use this plugin with Next.js, and when compiling / loading a page I get this error:

./node_modules/phaser-font-plugin/dist/index.mjs
Attempted import error: 'phaser' does not contain a default export (imported as 'i').

as the error says, it seems Phaser does not export a default so the way you import it with

import Phaser from 'phaser'

creates an error. I guess it doesn't for you because you build with a builder that might just do the magic, but Next doesn't.

Would it be possible for you to use the form

import * as Phaser from 'phaser'

or simply use the modules (Plugins / Loader) directly?

import { Plugins } from 'phaser';
import { Loader } from 'phaser';

Additional info

No response

hywax-assistant commented 1 month ago

👋 @dievardump Thanks for opening your first issue here! We'll try to help you as soon as possible.

If you like this project, please ⭐ star our repo.