[rollup-plugin-dynamic-import-variables] Unexpected token (25:51)
file: /home/alein10/Desktop/Sam Coding/test-vite/src/index.ts:25:51
error during build:
SyntaxError: Unexpected token (25:51)
at Parser.pp$4.raise (/home/alein10/Desktop/Sam Coding/test-vite/node_modules/rollup/dist/shared/rollup.js:16685:13)
at Parser.pp.unexpected (/home/alein10/Desktop/Sam Coding/test-vite/node_modules/rollup/dist/shared/rollup.js:14195:8)
at Parser.pp.semicolon (/home/alein10/Desktop/Sam Coding/test-vite/node_modules/rollup/dist/shared/rollup.js:14172:64)
at Parser.pp$1.parseExpressionStatement (/home/alein10/Desktop/Sam Coding/test-vite/node_modules/rollup/dist/shared/rollup.js:14651:8)
at Parser.pp$1.parseStatement (/home/alein10/Desktop/Sam Coding/test-vite/node_modules/rollup/dist/shared/rollup.js:14386:24)
at Parser.pp$1.parseBlock (/home/alein10/Desktop/Sam Coding/test-vite/node_modules/rollup/dist/shared/rollup.js:14667:21)
at Parser.pp$1.parseStatement (/home/alein10/Desktop/Sam Coding/test-vite/node_modules/rollup/dist/shared/rollup.js:14351:34)
at Parser.pp$1.parseIfStatement (/home/alein10/Desktop/Sam Coding/test-vite/node_modules/rollup/dist/shared/rollup.js:14496:26)
at Parser.pp$1.parseStatement (/home/alein10/Desktop/Sam Coding/test-vite/node_modules/rollup/dist/shared/rollup.js:14340:31)
at Parser.pp$1.parseBlock (/home/alein10/Desktop/Sam Coding/test-vite/node_modules/rollup/dist/shared/rollup.js:14667:21)
I am running ubuntu with node version 15.9.0 and npm version 7.5.3 .
I don’t know what is going on. Can anyone help? Thank you a lot in advance!
You have an unexpected token at line 25, character 51 of your index.ts file.
What is the code around that area? Please show us that code with about 5 lines both above and below the line 25, to help give us some context about the situation.
That link is giving me a 503 error, but I think you’ll find that people are (rightly, IMHO) reluctant to download unknown code. It is generally better to post code here or use a service like Codepen.
Just show us what your index.ts code is from lines 20 to 30. We can help to advise you from there.
Please make it clear to us which of them is the troubled line 25 line too.
Thanks for the website. I did what the only answer said to do and install @rollup/plugin-dynamic-import-vars and then configure it as a plugin in the config but I still get the error. Here is what The config looks like now: