pixi-keyboard
pixi-keyboard copied to clipboard
Uncaught ReferenceError: PIXI is not defined
I've installed the library with NPM and I have this in my index.ts
file (as by guide):
import * as PIXI from "pixi.js";
import "pixi-keyboard";
However, when I perform npm run dev
and access my game on the webserver, nothing renders and I get this error in console:
Uncaught ReferenceError: PIXI is not defined
keyboard pixi-keyboard.js:1
n pixi-keyboard.js:1
keyboard pixi-keyboard.js:1
n pixi-keyboard.js:1
keyboard pixi-keyboard.js:1
n pixi-keyboard.js:1
keyboard pixi-keyboard.js:1
<anonymous> pixi-keyboard.js:1
js game-library.js:596
__webpack_require__ game.js:849
fn game.js:151
<anonymous> index.ts:2
ts game.js:997
__webpack_require__ game.js:849
fn game.js:151
0 game.js:1046
__webpack_require__ game.js:849
checkDeferredModules game.js:46
<anonymous> game.js:925
<anonymous> game.js:928
pixi-keyboard.js:1
keyboard pixi-keyboard.js:1
n pixi-keyboard.js:1
keyboard pixi-keyboard.js:1
n pixi-keyboard.js:1
keyboard pixi-keyboard.js:1
n pixi-keyboard.js:1
keyboard pixi-keyboard.js:1
<anonima> pixi-keyboard.js:1
js game-library.js:596
__webpack_require__ game.js:849
fn game.js:151
<anonima> index.ts:2
ts game.js:997
__webpack_require__ game.js:849
fn game.js:151
0 game.js:1046
__webpack_require__ game.js:849
checkDeferredModules game.js:46
<anonima> game.js:925
<anonima> game.js:928
It gets fixed if I remove import "pixi-keyboard";
.
I'm running on Pixi.js 5.3.3, Pixi Viewport 4.17.1, Pixi Keyboard 1.0.0 Please, tell me if I need to provide any other information.
Any help? Thanks.