I created my first Pixi Project and loaded the pixi.js file as a module and my script main.js as a module after in the html header. In my Main i imported Application like in the Pixi Tutorial but i get this error and nothing loads.
#Import Error
16 messages · Page 1 of 1 (latest)
Did you write pixi.js on your own?
no i just downloaded the file
Try import*
Import * from "./pixi.js"
Import {PIXI} from "./PIXI.js"
doenst work either. Maybe the pixi discord knows but thanks anyway
There are two different ways to use pixi. One version requires using a bundler and the other does not. Most documentation is written with the assumption that you are using a bundler, but I don't think that they actually tell you this. It looks like you are probably not using a bundler.
If you are not using a bundler, you must not use the import statement at all. What you must do instead is place this script tag in your HTML before your other script that makes use of pixi.
<script src="https://pixijs.download/release/pixi.min.js"></script>
Also remove the other script tag for pixi that is currently in your code.
I got it to work with the file with the method you did I think but thanks
If you load pixi.js in your html file.
in main.js, "import" is don't need.
You can use Application class in your main.js