Esm: "SyntaxError: Invalid or unexpected token" on every even-numbered run after cache deletion

Created on 28 Aug 2018  Â·  6Comments  Â·  Source: standard-things/esm

Sounds like it's the reverse version of https://github.com/standard-things/esm/issues/568 .

  • If there is no cache, my fail whale test from nodemjs works as expected, i.e. throws and prints a stack trace.
  • The next time, it exits with "SyntaxError: Invalid or unexpected token" instead.
  • The 3rd time, it works again.
  • The 4th time, unexpected token again.
  • … and it repeats reliably.
$ rm -r node_modules/.cache/

$ ./test/failWhale.mjs ; echo rv=$?
W: loaderArgs are currently ignored! []
D: remaining process.argv: [ '/usr/bin/node',
  '/mnt/…/nodemjs/test/failWhale.mjs' ]
rv=23

$ ./test/failWhale.mjs ; echo rv=$?
W: loaderArgs are currently ignored! []
D: remaining process.argv: [ '/usr/bin/node',
  '/mnt/…/nodemjs/test/failWhale.mjs' ]
file:///mnt/…/nodemjs/test/failWhale.mjs:1
#!/usr/bin/env nodemjs

SyntaxError: Invalid or unexpected token
rv=1

$ for N in {1..16}; do ./test/failWhale.mjs &>/dev/null; echo rv=$?; done
rv=23
rv=1
rv=23
rv=1
rv=23
rv=1
rv=23
rv=1
rv=23
rv=1
rv=23
rv=1
rv=23
rv=1
rv=23
rv=1
bug

All 6 comments

I suspected it might have been due to my manipulation of process.argv, so I tried with process.argv[1] = 'bogus'. No difference, it still complained about, and showed, failWhale.mjs.

:+1: Thanks! :-)

I'd appreciate if you could release it to npm soon. I tried the commit syntax as dependency but somehow npm takes forever to install it this way.

v3.0.81 is released :tada:

Thanks! :+1: :tada:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

StphamZ picture StphamZ  Â·  3Comments

dnalborczyk picture dnalborczyk  Â·  3Comments

mAAdhaTTah picture mAAdhaTTah  Â·  3Comments

OmgImAlexis picture OmgImAlexis  Â·  3Comments

pvdlg picture pvdlg  Â·  3Comments