Skip to content
New issue

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

Unexpected token with ?. #166

Open
xavdid opened this issue Jun 29, 2021 · 0 comments
Open

Unexpected token with ?. #166

xavdid opened this issue Jun 29, 2021 · 0 comments

Comments

@xavdid
Copy link

xavdid commented Jun 29, 2021

I'm not sure if the problem is here (or in a subpackage, like detective, but I noticed this library tripping over semi-recent ES syntax. I'm not sure what the best fix is - if there's something on my end I can configure with browserify or if there's something in one of the related packages that needs to be updated to support newer syntax.

Either way, thanks a bunch!

Reproduction

t.js:

require("fs");

let o = {};
console.log(o?.a?.b);
$ module-deps t.js

events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: Parsing file t.js: Unexpected token (4:14)
    at Deps.parseDeps (.../module-deps/index.js:519:15)
    at getDeps (.../module-deps/index.js:447:44)
    at /module-deps/index.js:430:38
    ...

This was on Node.js 14, where the ?. syntax works as expected:

$ node t.js
undefined

Package Versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant