unjs / unplugin

Unified plugin system for Vite, Rollup, Webpack, esbuild, Rolldown, and more
https://unplugin.unjs.io
MIT License
2.9k stars 104 forks source link

Getting SyntaxError: Unexpected token, I think it's due to the optional chaining. #315

Closed ukhanzada-nisum-com closed 1 year ago

ukhanzada-nisum-com commented 1 year ago

Environment

"webpack": "^4.44.2",
"@sentry/webpack-plugin": "^2.2.2",
node: 12

Reproduction

When I am trying to build my app it gives me the error if I remove the below line it'll start working. const { sentryWebpackPlugin } = require("@sentry/webpack-plugin");

Describe the bug

const setup = (plugin) => plugin.esbuild?.setup ?? ((pluginBuild) => { SyntaxError: Unexpected token.

Screen Shot 2023-06-15 at 5 28 09 PM

Additional context

No response

Logs

No response

antfu commented 1 year ago

We temporarily close this due to the lack of enough information. Please provide a minimal reproduction to reopen the issue. Thanks.

Why reproduction is required

antfu commented 1 year ago

You should upgrade your node. v12 is EOL

pengfeir commented 1 year ago

I use node14.19.0 .has same question

pengfeir commented 1 year ago
image