Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dustinbolton opened this issue Jul 6, 2023 · 1 comment

Comments

@dustinbolton
Copy link

dustinbolton commented Jul 6, 2023

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?

@dschumak
Copy link

dschumak commented May 7, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants