Reputation: 393
I cannot access content in a JavaScript (.js) file. Vite throws:
[vite] Internal server error: Failed to parse source for import analysis because the content contains invalid JS syntax. If you are using JSX, make sure to name the file with the .jsx or .tsx extension.
Creating the vite.confis.js with the suggested content has no effect. If I remove the first line causing the error, the next import statement causes the same error.
Any ideas on how to correct this?
Upvotes: 0
Views: 12464
Reputation: 393
This error was due to a very stupid mistake - a function which was not fully closed by a brace. I am surprised that eslint did not indicate an error.
Upvotes: 13