https://repl.it/repls/ScarceOverjoyedRoute
Using the plaintext "process" should not stop the application from compiling. Every time I use "process" in the HTML section of a .svelte file, things break.
Finding the source of this issue took quite a while, I haven't found any other keywords that break compilation.
Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
Thanks for reporting. Do you have a stack trace handy you could add to the issue? (I'm away from my machine right now, but was curious)
src/main.js → public/build/bundle.js...
(!) Error when using sourcemap for reporting an error: Can't resolve original location of error.
src/App.svelte: (24:23)
[!] Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
src/App.svelte (24:23)
Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
at error (/home/runner/ScarceOverjoyedRoute/node_modules/rollup/dist/rollup.js:5365:30)
at Module.error (/home/runner/ScarceOverjoyedRoute/node_modules/rollup/dist/rollup.js:9708:9)
at tryParse (/home/runner/ScarceOverjoyedRoute/node_modules/rollup/dist/rollup.js:9617:16)
at Module.setSource (/home/runner/ScarceOverjoyedRoute/node_modules/rollup/dist/rollup.js:9935:33)
at Promise.resolve.catch.then.then.then (/home/runner/ScarceOverjoyedRoute/node_modules/rollup/dist/rollup.js:12205:20)
Hey folks. This issue hasn't received any traction for more than 90 days, so we're going to close this for housekeeping. If this is still an ongoing issue, please do consider contributing a Pull Request to resolve it. Further discussion is always welcome even with the issue closed. If anything actionable is posted in the comments, we'll consider reopening it.
@shellscape Please reopen the issue. I've just stumbled upon this and it took me a while to find out what was breaking the compilation. The error output is similar to that posted by @MichielLeyman.
We don't reopen stale issues unless someone is willing to take it on.
@shellscape I'm not familiar with the rollup codebase (first project with it). Could you at least point me where to look?
@ganigeorgiev If I recall correctly, this happened because I used the replace plugin a certain way to pass environment variables. I ended up making variables globally available instead, as a workaround in that project:
replace({
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
})
@MichielLeyman Ah, thank you.