Closed Tal500 closed 2 years ago
You are using a beta version of vite, this is going to be fixed in the next beta. See https://github.com/vitejs/vite/pull/10569 (already merged to vite main but not released)
Thanks for the report. I'll go ahead and close this since it's already been fixed as Dominik mentioned
You are using a beta version of vite, this is going to be fixed in the next beta. See vitejs/vite#10569 (already merged to vite main but not released)
Thanks, you're right! Tested and it works.
Describe the bug
Although this is a Vite related issue, I have decided to post it here since it will be clear and happens after @benmccann changes on Vite for fixing an issue for svelte, and I'm not sure how to construct an example using only Vite. I have used
git bisect
on Vite to found that it happen because of commit 325900601c4955d5a97459d4b80def1a724672f6 of Vite.When I try to load a specific library,
svelte-i18
, I get an error on Vite console:Unexpected token 'export'
.Reproduction
Repo: https://github.com/Tal500/demo-error-vite-unexpected-export
For the full reproduction story
create-svelte
, I used version2.0.0-next.187
, and with the following choices:package.json
, link vite via pnpm to your local version of Vite (on commit 325900601c4955d5a97459d4b80def1a724672f6):pnpm install && pnpm install --save-dev svelte-i18n
import 'svelte-i18n';
to the script in+layout.svelte
pnpm dev
You'll see the error on the (SSR) console, when opening
http://localhost:5173/
:Logs
Severity
blocking an upgrade
Additional Information
I'm sorry I've just said "it doesn't work with
svelte-i18n
library", I just didn't understand the logic enough to fix this, so I'm asking for your help, though I've found the exact version that causes the issue.Obviously, this issue is wider than a specific library.