davidfig/pixi-viewport

Uncaught SyntaxError: Cannot use import statement outside a module (at pixi_viewport.js:4:1)

Opened this issue · 1 comments

I am simply just trying to test this out in a web browser using the sample code from the documentation. For the life of me I cannot find any way to get this thing to work using the most basic of examples:

<script src="pixi.js"></script>
<script src="pixi_viewport.js"></script>
<script>
	const Viewport = new pixi_viewport.Viewport(options)
</script>

I get error Uncaught SyntaxError: Cannot use import statement outside a module (at pixi_viewport.js:4:1)
I tried adding type="module" for pixi_viewport.js but then get error Uncaught TypeError: Failed to resolve module specifier "@pixi/core". Relative references must start with either "/", "./", or "../".

I've tried other more complicated ways of setting up an ES environment for it and still no luck. I've never in my life had trouble getting a JS project functioning like this.

Is the documentation obsolete? How can I actually get it to work?

I am also getting this same problem, were you ever able to resolve?