melonJS icon indicating copy to clipboard operation
melonJS copied to clipboard

Can not start game in DEV mode after update to 14.1.0

Open wpernath opened this issue 3 years ago • 4 comments

Describe the bug After updating dependency from melonjs 14.0.x to 14.1.0, I get a strange error on startup which prevents my game from running in DEV mode with:

npm run dev

This is the exception:

grumpycat.bundle.js?59623714b512b3421667:2388 Uncaught TypeError: Class extends value undefined is not a constructor or null
    at eval (TMXLayer.js:89:78)
    at ./node_modules/melonjs/dist/melonjs.mjs/level/tiled/TMXLayer.js (grumpycat.bundle.js?59623714b512b3421667:1333:1)
    at __webpack_require__ (grumpycat.bundle.js?59623714b512b3421667:2385:33)
    at fn (grumpycat.bundle.js?59623714b512b3421667:2607:21)
    at eval (TMXRenderer.js:6:70)
    at ./node_modules/melonjs/dist/melonjs.mjs/level/tiled/renderer/TMXRenderer.js (grumpycat.bundle.js?59623714b512b3421667:1443:1)
    at __webpack_require__ (grumpycat.bundle.js?59623714b512b3421667:2385:33)
    at fn (grumpycat.bundle.js?59623714b512b3421667:2607:21)
    at eval (TMXOrthogonalRenderer.js:7:73)
    at ./node_modules/melonjs/dist/melonjs.mjs/level/tiled/renderer/TMXOrthogonalRenderer.js (grumpycat.bundle.js?59623714b512b3421667:1432:1)
eval @ TMXLayer.js:89
./node_modules/melonjs/dist/melonjs.mjs/level/tiled/TMXLayer.js @ grumpycat.bundle.js?59623714b512b3421667:1333
__webpack_require__ @ grumpycat.bundle.js?59623714b512b3421667:2385
fn @ grumpycat.bundle.js?59623714b512b3421667:2607
eval @ TMXRenderer.js:6
./node_modules/melonjs/dist/melonjs.mjs/level/tiled/renderer/TMXRenderer.js @ grumpycat.bundle.js?59623714b512b3421667:1443
__webpack_require__ @ grumpycat.bundle.js?59623714b512b3421667:2385
fn @ grumpycat.bundle.js?59623714b512b3421667:2607
eval @ TMXOrthogonalRenderer.js:7
./node_modules/melonjs/dist/melonjs.mjs/level/tiled/renderer/TMXOrthogonalRenderer.js @ grumpycat.bundle.js?59623714b512b3421667:1432
__webpack_require__ @ grumpycat.bundle.js?59623714b512b3421667:2385
fn @ grumpycat.bundle.js?59623714b512b3421667:2607
eval @ TMXTileMap.js:10
./node_modules/melonjs/dist/melonjs.mjs/level/tiled/TMXTileMap.js @ grumpycat.bundle.js?59623714b512b3421667:1366
__webpack_require__ @ grumpycat.bundle.js?59623714b512b3421667:2385
fn @ grumpycat.bundle.js?59623714b512b3421667:2607
eval @ level.js:10
./node_modules/melonjs/dist/melonjs.mjs/level/level.js @ grumpycat.bundle.js?59623714b512b3421667:1311
__webpack_require__ @ grumpycat.bundle.js?59623714b512b3421667:2385
fn @ grumpycat.bundle.js?59623714b512b3421667:2607
eval @ index.js:102
./node_modules/melonjs/dist/melonjs.mjs/index.js @ grumpycat.bundle.js?59623714b512b3421667:1234
__webpack_require__ @ grumpycat.bundle.js?59623714b512b3421667:2385
fn @ grumpycat.bundle.js?59623714b512b3421667:2607
eval @ utils.js:12
./node_modules/melonjs/dist/melonjs.mjs/utils/utils.js @ grumpycat.bundle.js?59623714b512b3421667:2125
__webpack_require__ @ grumpycat.bundle.js?59623714b512b3421667:2385
fn @ grumpycat.bundle.js?59623714b512b3421667:2607
eval @ container.js:5
./node_modules/melonjs/dist/melonjs.mjs/renderable/container.js @ grumpycat.bundle.js?59623714b512b3421667:1751
__webpack_require__ @ grumpycat.bundle.js?59623714b512b3421667:2385
fn @ grumpycat.bundle.js?59623714b512b3421667:2607
eval @ renderable.js:8
./node_modules/melonjs/dist/melonjs.mjs/renderable/renderable.js @ grumpycat.bundle.js?59623714b512b3421667:1806
__webpack_require__ @ grumpycat.bundle.js?59623714b512b3421667:2385
fn @ grumpycat.bundle.js?59623714b512b3421667:2607
eval @ sprite.js:9
./node_modules/melonjs/dist/melonjs.mjs/renderable/sprite.js @ grumpycat.bundle.js?59623714b512b3421667:1817
__webpack_require__ @ grumpycat.bundle.js?59623714b512b3421667:2385
fn @ grumpycat.bundle.js?59623714b512b3421667:2607
eval @ atlas.js:9
./node_modules/melonjs/dist/melonjs.mjs/video/texture/atlas.js @ grumpycat.bundle.js?59623714b512b3421667:2158
__webpack_require__ @ grumpycat.bundle.js?59623714b512b3421667:2385
fn @ grumpycat.bundle.js?59623714b512b3421667:2607
eval @ cache.js:7
./node_modules/melonjs/dist/melonjs.mjs/video/texture/cache.js @ grumpycat.bundle.js?59623714b512b3421667:2169
__webpack_require__ @ grumpycat.bundle.js?59623714b512b3421667:2385
fn @ grumpycat.bundle.js?59623714b512b3421667:2607
eval @ webgl_renderer.js:9
./node_modules/melonjs/dist/melonjs.mjs/video/webgl/webgl_renderer.js @ grumpycat.bundle.js?59623714b512b3421667:2334
__webpack_require__ @ grumpycat.bundle.js?59623714b512b3421667:2385
fn @ grumpycat.bundle.js?59623714b512b3421667:2607
eval @ video.js:15
./node_modules/melonjs/dist/melonjs.mjs/video/video.js @ grumpycat.bundle.js?59623714b512b3421667:2191
__webpack_require__ @ grumpycat.bundle.js?59623714b512b3421667:2385
fn @ grumpycat.bundle.js?59623714b512b3421667:2607
eval @ application.js:5
./node_modules/melonjs/dist/melonjs.mjs/application/application.js @ grumpycat.bundle.js?59623714b512b3421667:1102
__webpack_require__ @ grumpycat.bundle.js?59623714b512b3421667:2385
fn @ grumpycat.bundle.js?59623714b512b3421667:2607
eval @ game.js:6
./node_modules/melonjs/dist/melonjs.mjs/game.js @ grumpycat.bundle.js?59623714b512b3421667:1146
__webpack_require__ @ grumpycat.bundle.js?59623714b512b3421667:2385
fn @ grumpycat.bundle.js?59623714b512b3421667:2607
eval @ state.js:8
./node_modules/melonjs/dist/melonjs.mjs/state/state.js @ grumpycat.bundle.js?59623714b512b3421667:1883
__webpack_require__ @ grumpycat.bundle.js?59623714b512b3421667:2385
fn @ grumpycat.bundle.js?59623714b512b3421667:2607
eval @ loader.js:9
./node_modules/melonjs/dist/melonjs.mjs/loader/loader.js @ grumpycat.bundle.js?59623714b512b3421667:1465
__webpack_require__ @ grumpycat.bundle.js?59623714b512b3421667:2385
fn @ grumpycat.bundle.js?59623714b512b3421667:2607
eval @ bitmaptext.js:7
./node_modules/melonjs/dist/melonjs.mjs/text/bitmaptext.js @ grumpycat.bundle.js?59623714b512b3421667:1971
__webpack_require__ @ grumpycat.bundle.js?59623714b512b3421667:2385
fn @ grumpycat.bundle.js?59623714b512b3421667:2607
eval @ base-text-button.js:6
./src/main/client/js/util/base-text-button.js @ grumpycat.bundle.js?59623714b512b3421667:591
__webpack_require__ @ grumpycat.bundle.js?59623714b512b3421667:2385
fn @ grumpycat.bundle.js?59623714b512b3421667:2607
eval @ title-menu.js:6
./src/main/client/js/stage/title-menu.js @ grumpycat.bundle.js?59623714b512b3421667:547
__webpack_require__ @ grumpycat.bundle.js?59623714b512b3421667:2385
fn @ grumpycat.bundle.js?59623714b512b3421667:2607
eval @ title.js:8
./src/main/client/js/stage/title.js @ grumpycat.bundle.js?59623714b512b3421667:558
__webpack_require__ @ grumpycat.bundle.js?59623714b512b3421667:2385
fn @ grumpycat.bundle.js?59623714b512b3421667:2607
eval @ index.js:4
./src/main/client/index.js @ grumpycat.bundle.js?59623714b512b3421667:41
__webpack_require__ @ grumpycat.bundle.js?59623714b512b3421667:2385
(anonymous) @ grumpycat.bundle.js?59623714b512b3421667:3549
(anonymous) @ grumpycat.bundle.js?59623714b512b3421667:3551

Expected behavior Game should run in DEV mode as expected

Device (please complete the following information):

  • Device: MacStudio Max
  • OS: macOS 13.0
  • Browser: Chrome 106 + 107
  • melonJS Version: 14.1.0

Additional context

wpernath avatar Nov 02 '22 17:11 wpernath

Hi, yes, indeed I encountered the same problem... the issue is linked to the new melonjs.mjs "ES6 chunk build" that we now publish to enable tree-shaking. It was working initially and then between that and some dependencies update and official release it was not anymore, and I'm not sure why yet... :(

I will publish a 14.1.1 this morning that also disable tree-shaking, and will keep investigating.

thanks !

obiot avatar Nov 02 '22 23:11 obiot

@wpernath you can update to 14.1.1 now (just published) and it will solve the issue for now.

obiot avatar Nov 03 '22 00:11 obiot

@obiot thank you very much!

wpernath avatar Nov 03 '22 07:11 wpernath

I created an issue at rollup: https://github.com/rollup/rollup/issues/4704

as I'm literally out of idea on why this is happening and how to fix it :(

FYI @L1lith

obiot avatar Nov 05 '22 07:11 obiot

this one is fixed in the coming 14.2.0 release,

and comments shared with the rollup team : https://github.com/rollup/rollup/issues/4704

obiot avatar Dec 25 '22 02:12 obiot

version 14.2 released, and boilerplate updated accordingly, we can now close this one for good.

obiot avatar Dec 26 '22 03:12 obiot