X Tutup
The Wayback Machine - https://web.archive.org/web/20201201175212/https://github.com/vercel/pkg/issues/984
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

Cannot support ES8 Optional chaining (?.) #984

Open
axolo opened this issue Oct 18, 2020 · 1 comment
Open

Cannot support ES8 Optional chaining (?.) #984

axolo opened this issue Oct 18, 2020 · 1 comment

Comments

@axolo
Copy link

@axolo axolo commented Oct 18, 2020

D:\snapshot\lpcheer-api\app\controller\feedback.js:35
    const userId = state.auth?.userId;
                              ^

SyntaxError: Unexpected token '.'
    at new Script (vm.js:89:7)
    at Socket.<anonymous> ([eval]:18:19)
    at Socket.emit (events.js:315:20)
    at addChunk (_stream_readable.js:295:12)
    at readableAddChunk (_stream_readable.js:271:9)
    at Socket.Readable.push (_stream_readable.js:212:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:186:23)
@josiahbryan
Copy link

@josiahbryan josiahbryan commented Oct 31, 2020

I personally use rollup/babel to build/transpile my code into a "more widely supported" version before using pkg - this could help you.

Personally, I write all my code using the latest supported node at work (Node 12 in my case), but for our target devices, we have to use Node 8 (due to GCC ver on the embedded device.)

Therefore, I use rollup to transpile my development code down to something that runs on Node 8, and then use pkg to target node 8 / armv7 for the final binary.

YMMV, HTH.

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.
X Tutup