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

Not transpiling nullish coalesce with typescript #889

Open
judocode opened this issue Mar 8, 2022 · 1 comment
Open

Not transpiling nullish coalesce with typescript #889

judocode opened this issue Mar 8, 2022 · 1 comment

Comments

@judocode
Copy link

judocode commented Mar 8, 2022

We are attempting to use ncc to transpile some typescript code into a single js file, and some of the dependencies include code that includes a nullish coalesce operator and it seems to simply ignore them and outputs it in the outputted js file which gives the following error when you attempt and run via node dist/index.js:

const d = options.lastModified ?? Date.now()
                                    ^

SyntaxError: Unexpected token '?'

I have the target defined both in the command: ncc build -a -e typescript --target es2015 src/main.ts

and in the tsconfig file:

{
  "compilerOptions": {
    "target": "es2015",
    "module": "commonjs",
    "moduleResolution": "node"
  }
}

Node version: 14

@styfle
Copy link
Member

styfle commented Mar 9, 2022

This looks like a duplicate of #873

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

2 participants