#Import Error

16 messages · Page 1 of 1 (latest)

twilit harbor
#

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.

opaque mist
twilit harbor
#

no i just downloaded the file

opaque mist
#

Try import*

opaque mist
twilit harbor
#

Doenst work

opaque mist
#

Import {PIXI} from "./PIXI.js"

twilit harbor
#

doenst work either. Maybe the pixi discord knows but thanks anyway

opaque mist
#

This guide is not saying to add type module

upbeat gyro
#

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.

twilit harbor
#

I got it to work with the file with the method you did I think but thanks

hearty quest
#

You can use Application class in your main.js