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

SyntaxError: Unexpected token - rollup-plugin-invariant #295

Open
lucoceano opened this issue May 18, 2022 · 0 comments
Open

SyntaxError: Unexpected token - rollup-plugin-invariant #295

lucoceano opened this issue May 18, 2022 · 0 comments

Comments

@lucoceano
Copy link

Hi, after adding browserslist to package.json I started getting Unexpected token error when building the bundle, do you might have an idea why?

When there is no browserslist on the package.json it all works fine

browserlist:

"browserslist": [
    "last 2 chrome major version",
],

devDependecies:

"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^20.0.0",
"@rollup/plugin-json": "4.1.0",
"@rollup/plugin-node-resolve": "^13.0.0",
"@rollup/plugin-replace": "^2.4.2",
"rollup": "^2.53.0",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-invariant": "^0.9.2",
"rollup-plugin-postcss": "^4.0.0",

Error:

[!] (plugin rollup-plugin-invariant) SyntaxError: Unexpected token (18:7)
src/index.tsx (18:7)
SyntaxError: Unexpected token (18:7)
    at Parser.pp$4.raise (/node_modules/rollup/dist/shared/rollup.js:16909:13)
    at Parser.pp.unexpected (/node_modules/rollup/dist/shared/rollup.js:14417:8)
    at Parser.pp.expect (/node_modules/rollup/dist/shared/rollup.js:14411:26)
    at Parser.pp$1.parseExportSpecifiers (/node_modules/rollup/dist/shared/rollup.js:15402:8)
    at Parser.pp$1.parseExport (/node_modules/rollup/dist/shared/rollup.js:15323:28)
    at Parser.pp$1.parseStatement (/node_modules/rollup/dist/shared/rollup.js:14593:72)
    at Parser.pp$1.parseTopLevel (/node_modules/rollup/dist/shared/rollup.js:14474:21)
    at Parser.parse (/node_modules/rollup/dist/shared/rollup.js:14266:15)
    at Function.parse (/node_modules/rollup/dist/shared/rollup.js:14297:35)
    at Graph.contextParse (/node_modules/rollup/dist/shared/rollup.js:20278:38)
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