-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Rollup Plugin - Unexpected Token #8664
Comments
This comment was marked as outdated.
This comment was marked as outdated.
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
}, I don't think that's the problem, in any case this part of code in the vite.config.js file should enable me dynamic imports via the Also, as I said before, if I delete the contents of the |
Hmm yeah it was a brainfart that I thought the dynamic imports was interfering it, as it only happens when interpolating variables in dynamic imports. Sorry for the fuss, re-opening. |
I don't see anything strange with fetch("${import.meta.env.VITE_API_URL}/api/admin/remove?id=" + id, { not using backticks, but I doubt that's the issue. I can't build the repro too to test it out so I'm not sure what else to do. But since you have your local project in hand, you can try slowly removing parts of the code in |
oh my god.... I don't want to believe it... apparently that was the mistake, I just didn't notice that I used " instead of `... Thank you very much, it was an attention error then, hahahah. Very kind guys ;) |
Describe the bug
I am trying to build a web-app that I am developing with vite, vue and pinia, during the development, using the script
npm run dev
oryarn dev
I get no error. But when I have to build the web-app, I get a rollup-plugin error, which redirects to a line of code that doesn't seem to make sense. I've also tried deleting the contents of the file, and it builds perfectly, but if I paste the same content into another file, it goes back to not working.The line of code (reported in the logs below, or 146:20) is this:
which is strange, because there is no col 20 on this line.
I can't upload the whole project to stackblitz (because there are more than 150 files), but I only upload the main files, including the one where I get the error.
There is already an issue with this "subject" only I could not solve it according to my requirement, I also tried to import and implement
rollup-plugin-dynamic-import-variables
in the configuration in thevite.config.js
file (as depicted below), but it seems useless, also because it should be already implemented by default byvite.js
Reproduction
https://stackblitz.com/edit/vitejs-vite-gbyfmu?file=vite.config.js,index.html,components.d.ts,package.json,src%2Frouter%2Findex.js,src%2Fviews%2Fbackend%2FAdminsView.vue,src%2FApp.vue,src%2Fmain.js&terminal=dev
System Info
Used Package Manager
npm
Logs
Validations
The text was updated successfully, but these errors were encountered: