stefanpenner / hash-for-dep

7 stars 11 forks source link

TypeError: cannot stop: not the current node #36

Closed pittst3r closed 7 years ago

pittst3r commented 7 years ago

I ran into the following error with @glimmer/build, talked to @rwjblue about it and he said that it looked like a bug here. This PR fixes it temporarily.

TypeError: cannot stop: not the current node
    at Cookie.stop (/Users/rpitts/Repos/personal/glimmer-build/node_modules/heimdalljs/dist/heimdalljs.cjs.js:1625:15)
    at /Users/rpitts/Repos/personal/glimmer-build/node_modules/heimdalljs/dist/heimdalljs.cjs.js:1948:23
    at /Users/rpitts/Repos/personal/glimmer-build/node_modules/heimdalljs/dist/heimdalljs.cjs.js:1367:34
    at tryCatch (/Users/rpitts/Repos/personal/glimmer-build/node_modules/heimdalljs/dist/heimdalljs.cjs.js:533:12)
    at invokeCallback (/Users/rpitts/Repos/personal/glimmer-build/node_modules/heimdalljs/dist/heimdalljs.cjs.js:545:13)
    at publish (/Users/rpitts/Repos/personal/glimmer-build/node_modules/heimdalljs/dist/heimdalljs.cjs.js:516:7)
    at publishRejection (/Users/rpitts/Repos/personal/glimmer-build/node_modules/heimdalljs/dist/heimdalljs.cjs.js:459:3)
    at flush (/Users/rpitts/Repos/personal/glimmer-build/node_modules/heimdalljs/dist/heimdalljs.cjs.js:1525:5)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
stefanpenner commented 7 years ago

@robbiepitts the stack trace appears to ahve nothing to do with hash-for-dep, looks like an issue in heimdall v0.2

rwjblue commented 7 years ago

It's definitely hash-for-dep. We are creating nodes and not stopping them or something when provided a directory that does not contain a package.json.

rwjblue commented 7 years ago

I'll put up a failing test tomorrow, but I asked @robbiepitts to open the issue so I didn't forget.

stefanpenner commented 7 years ago

heimdall looks to correctly balance this: https://github.com/stefanpenner/hash-for-dep/blob/de369f3b24f6d38aad7bf723fe475d0b7334c309/index.js#L57-L96

The exception is if an exception is thrown, at which point the program should crash. I believe the issue is heimdall should be more forgiving in this scenario, maybe just warn, rather then hiding the root cause.

cc @cthoburn / @hjdivad

stefanpenner commented 7 years ago

I believe this is fixed upstream