standard-things / esm

Tomorrow's ECMAScript modules today!
Other
5.27k stars 147 forks source link

Silent fail with Electron v1 #750

Closed janusqa closed 5 years ago

janusqa commented 5 years ago

Hi I went from "esm": "^3.2.11" to "esm": "^3.2.17" and something stopped working. I am using it with cypress.io. I have been using it with full success in linux and partial success in windows. See from https://github.com/cypress-io/cypress/issues/3678. This update has stopped it from working all together, to the point where I am not even getting any error output as to what could be the reason.

jdalton commented 5 years ago

Hi @janusqa!

Can you please step your version of esm up until it has a problem (to v3.2.12, to v3.2.13, ...). This will help narrow down the possible issue.

janusqa commented 5 years ago

Hi @jdalton it was great up until "esm": "3.2.14", From "esm": "3.2.15" onward to "esm": "3.2.17", it does not work for me in my situation. I've left the "app" loading to see if its just the case that its slow to load or if it will eventually produce an error.

Waiting bore no results.

jdalton commented 5 years ago

If you could create a small repro repo that would be helpful. Otherwise you can view the list of changes to see if anything jumps out https://github.com/standard-things/esm/compare/3.2.14...3.2.15.

janusqa commented 5 years ago

@jdalton

https://github.com/janusqa/janusqa-cypress-test-tiny-plugin3-esm

I've set it in package.json to 3.2.14.

npm install node_modules/.bin/cypress open

It should open successfully and a spec should load in less than 5 seconds.

change to 3.2.15

npm install node_modules/.bin/cypress open

It should open and hang.

Will take a look at the changes.

jdalton commented 5 years ago

Thanks @janusqa!

I narrowed it down to https://github.com/standard-things/esm/commit/70bac763f55c3272f9e4064349f8764eb8fef743.

OmgImAlexis commented 5 years ago

I'm guessing this is related? Rolling back to 3.2.11 allowed my server to come back up.

TypeError: Cannot read property 'options' of null
    at /mnt/disks/code/api/node_modules/esm/esm.js:1:193023
    at Object.e (/mnt/disks/code/api/node_modules/esm/esm.js:1:193054)
    at Object.<anonymous> (/mnt/disks/code/api/node_modules/esm/esm.js:1:193840)
    at Object.apply (/mnt/disks/code/api/node_modules/esm/esm.js:1:193630)
    at Object.[nodejs.util.inspect.custom] (/mnt/disks/code/api/node_modules/esm/esm.js:1:198211)
    at formatValue (internal/util/inspect.js:453:31)
    at inspect (internal/util/inspect.js:193:10)
    at Object.formatWithOptions (util.js:85:12)
    at Object.Console.(anonymous function) (console.js:188:15)
    at Object.log (console.js:199:31)
jdalton commented 5 years ago

@OmgImAlexis No, I think your issue is more related to #752

@janusqa I found the issue. It comes down to a single line of code.

Update:

Patch https://github.com/standard-things/esm/commit/3953a53279aeec36844ce7bc13cc24deb3953388; Related to #333;

The fix was to reintroduce a bug fix for Electron v1 (which Cypress uses still). With any luck this will improve Cypress support all-up 🎉

janusqa commented 5 years ago

@jdalton Thanks! Do you know when it will be available in the npm?

jdalton commented 5 years ago

esm v3.2.18 is released :tada: