Jump to content

Trouble with ES6 and Webpack | Uncaught ReferenceError: PIXI is not defined


Recommended Posts

A bit of a Webpack and ES6 noob here.


At the top of my main.js I have:

import 'pixi';
import 'p2';
import Phaser from 'phaser'

All of which are installed via NPM. I don't have anything in my webpack configuration relevant to this, some posts online I have seen have mentioned methods of doing it that way i guess.



The webpack build finishes and I get nothing in the browser but I get this console error.



phaser.js:23282 Uncaught ReferenceError: PIXI is not defined
    at phaser.js:23282
    at Object.<anonymous> (phaser.js:103061)
    at Object.module.exports (phaser.js:103063)
    at __webpack_require__ (bootstrap 2c860b41a8016573ba2d:19)
    at Object.<anonymous> (app.js:3)
    at __webpack_require__ (bootstrap 2c860b41a8016573ba2d:19)
    at module.exports (bootstrap 2c860b41a8016573ba2d:62)
    at bootstrap 2c860b41a8016573ba2d:62



Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...