alexisvincent / systemjs-hot-reloader

reloads your modules as needed so that you can have satisfyingly fast feedback loop when developing your app
MIT License
228 stars 36 forks source link

RangeError: Maximum call stack size exceeded #127

Closed dougludlow closed 7 years ago

dougludlow commented 7 years ago

I'm trying to test out your latest updates to the systemjs-hot-reloader on master, but I get the following error when importing:

Error: connect is not defined

I tracked it down to dist/index.js:9432.

Apparently, the browser doesn't like the use of the undeclared connect variable, an issue in transpilation I guess. Removing the 'use strict'; directive, placing a var connect before or removing connect altogether resolves this. Not sure what needs to happen in lib/index.js:7. Perhaps not exporting a named function? or declaring the function above and then exporting it?

dougludlow commented 7 years ago

Getting past that error (using a method above), I'm now seeing this:

Uncaught ReferenceError: transform is not defined

Which maps back to lib/index.js:29 and I see that transform is most definitely not defined.

Am I testing the correct branch? Jumping the gun little?

dougludlow commented 7 years ago

FWIW, I submitted a pr to fix the above mentioned items. Works perfect on the electron/angular2 project I'm working on! 👍

alexisvincent commented 7 years ago

Thanks. I actually haven't run tests on the current branch yet. Can release this weekend.

alexisvincent commented 7 years ago

@dougludlow Any chance you can test the latest github master with your project. I think everything is perfect, but I want to make sure before I release.

dougludlow commented 7 years ago

@alexisvincent it seems to be working just fine. Thanks!

I see these warnings when files are reloaded (System.config({ warnings: true })):

SystemJS.has is deprecated for SystemJS.registry.has
SystemJS.get is deprecated for SystemJS.registry.get
SystemJS.delete is deprecated for SystemJS.registry.delete

Also, not sure if it's related to your updates, but I get the following error now when I attempt to bundle with systemjs-builder, where I didn't before:

TypeError: name.match is not a function
    at isPlain (/Users/doug/Source/inofile/kno2-electron/node_modules/systemjs-builder/lib/trace.js:204:58)
    at toPackagePath (/Users/doug/Source/inofile/kno2-electron/node_modules/systemjs-builder/lib/trace.js:222:13)
    at /Users/doug/Source/inofile/kno2-electron/node_modules/systemjs-builder/lib/trace.js:300:20

As a side note, I'm using the systemjs-hot-reloader, but I'm importing lib/index.js instead of dist/index.js because it's importing an empty module otherwise (another issue). You may want to add systemjs-hmr as a dependency to systemjs-hot-reloader instead of bundling it in the dist/index.js.

dougludlow commented 7 years ago

@alexisvincent I am seeing this error occur:

RangeError: Maximum call stack size exceeded
    at hash (file:///Users/doug/Source/my-app/client/jspm_packages/npm/systemjs-hmr@2.0.5/dist/systemjs-hmr.js:6834:16)
    at HashArrayMapNode.update (file:///Users/doug/Source/my-app/client/jspm_packages/npm/systemjs-hmr@2.0.5/dist/systemjs-hmr.js:7376:19)
    at updateNode (file:///Users/doug/Source/my-app/client/jspm_packages/npm/systemjs-hmr@2.0.5/dist/systemjs-hmr.js:7665:17)
    at updateMap (file:///Users/doug/Source/my-app/client/jspm_packages/npm/systemjs-hmr@2.0.5/dist/systemjs-hmr.js:7640:17)
    at Map.remove (file:///Users/doug/Source/my-app/client/jspm_packages/npm/systemjs-hmr@2.0.5/dist/systemjs-hmr.js:7071:14)
    at Set.remove (file:///Users/doug/Source/my-app/client/jspm_packages/npm/systemjs-hmr@2.0.5/dist/systemjs-hmr.js:9639:40)
    at file:///Users/doug/Source/my-app/client/jspm_packages/npm/systemjs-hmr@2.0.5/dist/systemjs-hmr.js:11033:49
    at Array.forEach (native)
    at removeDepsOf (file:///Users/doug/Source/my-app/client/jspm_packages/npm/systemjs-hmr@2.0.5/dist/systemjs-hmr.js:11029:56)
    at file:///Users/doug/Source/my-app/client/jspm_packages/npm/systemjs-hmr@2.0.5/dist/systemjs-hmr.js:11034:13
    at Array.forEach (native)
    at removeDepsOf (file:///Users/doug/Source/my-app/client/jspm_packages/npm/systemjs-hmr@2.0.5/dist/systemjs-hmr.js:11029:56)
    at file:///Users/doug/Source/my-app/client/jspm_packages/npm/systemjs-hmr@2.0.5/dist/systemjs-hmr.js:11034:13
    at Array.forEach (native)
    at removeDepsOf (file:///Users/doug/Source/my-app/client/jspm_packages/npm/systemjs-hmr@2.0.5/dist/systemjs-hmr.js:11029:56)
    at file:///Users/doug/Source/my-app/client/jspm_packages/npm/systemjs-hmr@2.0.5/dist/systemjs-hmr.js:11034:13
From previous event:
    at ZoneDelegate.invoke (file:///Users/doug/Source/my-app/client/bundle.js:213305:168)
    at Zone.run (file:///Users/doug/Source/my-app/client/bundle.js:213124:47)
    at file:///Users/doug/Source/my-app/client/bundle.js:213623:61
    at ZoneDelegate.invokeTask (file:///Users/doug/Source/my-app/client/bundle.js:213330:181)
    at Zone.runTask (file:///Users/doug/Source/my-app/client/bundle.js:213165:51)
    at drainMicroTaskQueue (file:///Users/doug/Source/my-app/client/bundle.js:213488:39)
From previous event:
    at SystemJSLoader$1.System.reload (file:///Users/doug/Source/my-app/client/jspm_packages/npm/systemjs-hmr@2.0.5/dist/systemjs-hmr.js:11141:28)
    at Socket.<anonymous> (file:///Users/doug/Source/my-app/client/jspm_packages/github/dougludlow/systemjs-hot-reloader@master/lib/index.js!transpiled:39:20)
    at Socket.Emitter.emit (file:///Users/doug/Source/my-app/client/jspm_packages/github/socketio/socket.io-client@1.7.2/dist/socket.io.js:6856:21)
    at Socket.onevent (file:///Users/doug/Source/my-app/client/jspm_packages/github/socketio/socket.io-client@1.7.2/dist/socket.io.js:7878:11)
    at Socket.onpacket (file:///Users/doug/Source/my-app/client/jspm_packages/github/socketio/socket.io-client@1.7.2/dist/socket.io.js:7836:13)
    at Manager.<anonymous> (file:///Users/doug/Source/my-app/client/jspm_packages/github/socketio/socket.io-client@1.7.2/dist/socket.io.js:8101:16)
    at Manager.Emitter.emit (file:///Users/doug/Source/my-app/client/jspm_packages/github/socketio/socket.io-client@1.7.2/dist/socket.io.js:6856:21)
    at Manager.ondecoded (file:///Users/doug/Source/my-app/client/jspm_packages/github/socketio/socket.io-client@1.7.2/dist/socket.io.js:3558:9)
    at Decoder.<anonymous> (file:///Users/doug/Source/my-app/client/jspm_packages/github/socketio/socket.io-client@1.7.2/dist/socket.io.js:8101:16)
    at Decoder.Emitter.emit (file:///Users/doug/Source/my-app/client/jspm_packages/github/socketio/socket.io-client@1.7.2/dist/socket.io.js:3011:21)
    at Decoder.add (file:///Users/doug/Source/my-app/client/jspm_packages/github/socketio/socket.io-client@1.7.2/dist/socket.io.js:1276:13)
    at Manager.ondata (file:///Users/doug/Source/my-app/client/jspm_packages/github/socketio/socket.io-client@1.7.2/dist/socket.io.js:3548:17)
    at Socket.<anonymous> (file:///Users/doug/Source/my-app/client/jspm_packages/github/socketio/socket.io-client@1.7.2/dist/socket.io.js:8101:16)
    at Socket.Emitter.emit (file:///Users/doug/Source/my-app/client/jspm_packages/github/socketio/socket.io-client@1.7.2/dist/socket.io.js:6856:21)
    at Socket.onPacket (file:///Users/doug/Source/my-app/client/jspm_packages/github/socketio/socket.io-client@1.7.2/dist/socket.io.js:4266:15)
    at WS.<anonymous> (file:///Users/doug/Source/my-app/client/jspm_packages/github/socketio/socket.io-client@1.7.2/dist/socket.io.js:4083:11)
    at WS.Emitter.emit (file:///Users/doug/Source/my-app/client/jspm_packages/github/socketio/socket.io-client@1.7.2/dist/socket.io.js:6856:21)
    at WS.Transport.onPacket (file:///Users/doug/Source/my-app/client/jspm_packages/github/socketio/socket.io-client@1.7.2/dist/socket.io.js:5514:9)
    at WS.Transport.onData (file:///Users/doug/Source/my-app/client/jspm_packages/github/socketio/socket.io-client@1.7.2/dist/socket.io.js:5506:9)
alexisvincent commented 7 years ago

@dougludlow Any chance you can provide a reproducible case? Btw, I released v1.0.0 which includes systemjs-hmr as a dep.

dougludlow commented 7 years ago

@alexisvincent I'll see what I can do.

alexisvincent commented 7 years ago

@dougludlow Awesome thanks :) If you're hitting this, likely others will to. And now this version is out in the wild, want to kill it as soon as possible.

dougludlow commented 7 years ago

@alexisvincent here's a demo project where the case happens consistently for me:

https://github.com/dougludlow/systemjs-hmr-recursion-error-demo

Let me know if you have any questions.

alexisvincent commented 7 years ago

Awesome! Thanks

alexisvincent commented 7 years ago

fixed in sytemjs-hmr v2.0.6