davidfig / pixi-viewport

A highly configurable viewport/2D camera designed to work with pixi.js
https://davidfig.github.io/pixi-viewport/
MIT License
1.02k stars 171 forks source link

failed to import @pixi/core and @pixi/display #472

Closed Markhamm closed 8 months ago

Markhamm commented 8 months ago

Hi,

Thanks for the work you do, I was using the version 4.X and it worked like a charm.

I need to upgrade to version 5 (with Pixijs 7) but I'm having issues to load pixi-viewport js in my html. I'm retrieving the last version from https://github.com/davidfig/pixi-viewport/releases/ (pixi_viewport.js) but when the page loads using:

<script type="module" src="./js/pixi_viewport.js"></script>

I'm getting the following error:

“Uncaught TypeError: The specifier @pixi/core” was a bare specifier, but was not remapped to anything. Relative module specifiers must start with “./”, “…/” or “/”.”

I also tried without type="module". "viewport.min.js" in version 4.38.0 works (with pixijs 5), could you please generate a "standalone" version of pixi_viewport.js ? Small precision here, I'm not using node, or ts, pure js here.

Thanks for your help!

Markhamm commented 8 months ago

Okay, using pixi_viewport.umd.cjs it works, it wasn't obvious for a newby like me.