We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use of esm causes optional chaining to be viewed as invalid syntax. Here's an example:
esm
import get from 'lodash/fp/get'; const a = { a: { b: 5 } }; console.log(get(['a', 'b'], a)); console.log(a?.a?.b); console.log(get(['a', 'c'], a)); console.log(a?.a?.c);
Running node --experimental-specifier-resolution=node test.js outputs the following:
node --experimental-specifier-resolution=node test.js
5 5 undefined undefined
But running node -r esm test.js outputs this error:
node -r esm test.js
/Users/dlj/projects/esm_test/test.js:6 console.log(a?.a?.b); ^ SyntaxError: Invalid or unexpected token at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
The text was updated successfully, but these errors were encountered:
Probably also worth pointing out that we're looking into switching to using the ESM support in node 14, but we're currently blocked by this issue
Sorry, something went wrong.
This is probably related to #866.
Yes, this is a duplicate of that issue
No branches or pull requests
Use of
esm
causes optional chaining to be viewed as invalid syntax. Here's an example:Running
node --experimental-specifier-resolution=node test.js
outputs the following:But running
node -r esm test.js
outputs this error:The text was updated successfully, but these errors were encountered: