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
esbuild: Unterminated string literal when building SSR bundle #3985
Comments
Does this happen on Vercel only? It seems like this is a Vite issue, specifically it's scanner where it's used during SSR builds too. Usually the scanner is invoked when there's no vitejs/vite#6863 is the only recent change to the scanner, but it shouldn't cause this issue I think. Does Vite 2.8.0 (not 2.8.1) work? |
Unfortunately, vite 2.8.0 doesn't work. I've also tried removing the adapter all together and there's no change, the build still fails, including with other adapters (I've tried static and nodejs so far) |
I've managed to reproduce the issue locally and have made a tiny amount of headway. I know nothing about how esbuild works but I think the issue is happening somewhere in the process of reading the text chunks from disk and passing them off to be parsed, specifically placing a console.log at esbuild's main.js line 760 spits out this: console.log(packet.value)
{
errors: [],
outputFiles: [ { contents: [Uint8Array], path: '<stdout>' } ],
rebuild: false,
warnings: [],
watch: false
}
{
errors: [
{
detail: -1,
location: [Object],
notes: [],
pluginName: '',
text: 'Unterminated string literal'
}
],
outputFiles: [],
rebuild: false,
warnings: [],
watch: false
} While I have figured out how to work around this locally, I still have no way of getting a build to work in an environment like vercel's, unless I can manually create the build output and push it to vercel which I have no idea how to do |
This is being triggered by the commented out Change: <svelte:head>
<title>welcome | DRACONIUM</title>
<!--eggs lmao-->
<meta name='keywords' content='Draconium, music, eggs' />
<meta name='description' content={metaDescription} />
<!--<script src="//cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.7/ScrollMagic.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.7/plugins/debug.addIndicators.min.js"></script>-->
</svelte:head> to <svelte:head>
<title>welcome | DRACONIUM</title>
<!--eggs lmao-->
<meta name='keywords' content='Draconium, music, eggs' />
<meta name='description' content={metaDescription} />
</svelte:head> ... and the issue goes away. |
Thanks @CaptainCodeman! That investigation sped things up for me quite a bit. I sent a fix for the issue here: vitejs/vite#7202 |
As ben said, thanks @CaptainCodeman! The fix works perfectly and I've had no other issues |
The fix for this has been merged into Vite and will be included in Vite 2.9 |
Describe the bug
This is an issue that first appeared for me 2 days ago, where all builds would fail because of a seemingly incomplete import statement in one specific file, where no such import statement existed. This could be fixed by deleting the file, starting the devserver, then adding the file back in while it's running. This workaround, however as far as I know, is not practical when deploying to Vercel in this case, as it would probably take a script to run the dev server with the file deleted, then subsequently readding it.
To the best of my knowledge, this does not have anything to do with vite, since I was unable to reproduce it with the SSR projects provided.
Reproduction
A copy of the project is on https://github.com/murl-digital/draconium.productions-mirror, and the problem has to do with
/src/routes/index.svelte
.Logs
System Info
Unable to run on Vercel, but here's my local machine where I also encountered this bug on.
Severity
blocking all usage of SvelteKit
Additional Information
No response
The text was updated successfully, but these errors were encountered: