You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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'.
create-svelte, I used version 2.0.0-next.187, and with the following choices:
? Which Svelte app template? » SvelteKit demo app
? Add type checking with TypeScript? » Yes, using JavaScript with JSDoc comments
? Add ESLint for code linting? ... No
? Add Prettier for code formatting? ... No
? Add Playwright for browser testing? ... No
Add 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/:
Unexpected token 'export'
C:\Src\my-demo-error\node_modules\.pnpm\tslib@2.4.0\node_modules\tslib\tslib.es6.js:24
export function __extends(d, b) {
^^^^^^
SyntaxError: Unexpected token 'export'
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1033:15)
at Module._compile (node:internal/modules/cjs/loader:1069:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:827:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Src\my-demo-error\node_modules\.pnpm\intl-messageformat@9.13.0\node_modules\intl-messageformat\index.js:8:15)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
Unexpected token 'export'
C:\Src\my-demo-error\node_modules\.pnpm\tslib@2.4.0\node_modules\tslib\tslib.es6.js:24
export function __extends(d, b) {
^^^^^^
SyntaxError: Unexpected token 'export'
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1033:15)
at Module._compile (node:internal/modules/cjs/loader:1069:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:827:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Src\my-demo-error\node_modules\.pnpm\intl-messageformat@9.13.0\node_modules\intl-messageformat\index.js:8:15)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
Not found: /favicon.ico
Error: Not found: /favicon.ico
at resolve (file:///C:/Src/my-demo-error/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.522_svelte@3.52.0/node_modules/@sveltejs/kit/src/runtime/server/index.js:259:13)
at resolve (file:///C:/Src/my-demo-error/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.522_svelte@3.52.0/node_modules/@sveltejs/kit/src/runtime/server/index.js:290:5)
at Object.handle (file:///C:/Src/my-demo-error/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.522_svelte@3.52.0/node_modules/@sveltejs/kit/src/exports/vite/dev/index.js:340:66)
at respond (file:///C:/Src/my-demo-error/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.522_svelte@3.52.0/node_modules/@sveltejs/kit/src/runtime/server/index.js:287:40)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at file:///C:/Src/my-demo-error/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.522_svelte@3.52.0/node_modules/@sveltejs/kit/src/exports/vite/dev/index.js:410:22
Unexpected token 'export'
C:\Src\my-demo-error\node_modules\.pnpm\tslib@2.4.0\node_modules\tslib\tslib.es6.js:24
export function __extends(d, b) {
^^^^^^
SyntaxError: Unexpected token 'export'
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1033:15)
at Module._compile (node:internal/modules/cjs/loader:1069:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:827:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Src\my-demo-error\node_modules\.pnpm\intl-messageformat@9.13.0\node_modules\intl-messageformat\index.js:8:15)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
Logs
C:\Src\my-demo-error>pnpm dev
> my-demo-error@0.0.1 dev C:\Src\my-demo-error
> vite dev
VITE v3.2.0-beta.1 ready in 2008 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
Unexpected token 'export'
C:\Src\my-demo-error\node_modules\.pnpm\tslib@2.4.0\node_modules\tslib\tslib.es6.js:24
exportfunction__extends(d, b) {
^^^^^^
SyntaxError: Unexpected token 'export'
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1033:15)
at Module._compile (node:internal/modules/cjs/loader:1069:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:827:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Src\my-demo-error\node_modules\.pnpm\intl-messageformat@9.13.0\node_modules\intl-messageformat\index.js:8:15)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
Unexpected token 'export'
C:\Src\my-demo-error\node_modules\.pnpm\tslib@2.4.0\node_modules\tslib\tslib.es6.js:24
exportfunction__extends(d, b) {
^^^^^^
SyntaxError: Unexpected token 'export'
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1033:15)
at Module._compile (node:internal/modules/cjs/loader:1069:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:827:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Src\my-demo-error\node_modules\.pnpm\intl-messageformat@9.13.0\node_modules\intl-messageformat\index.js:8:15)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
Not found: /favicon.ico
Error: Not found: /favicon.ico
at resolve (file:///C:/Src/my-demo-error/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.522_svelte@3.52.0/node_modules/@sveltejs/kit/src/runtime/server/index.js:259:13)
at resolve (file:///C:/Src/my-demo-error/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.522_svelte@3.52.0/node_modules/@sveltejs/kit/src/runtime/server/index.js:290:5)
at Object.handle (file:///C:/Src/my-demo-error/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.522_svelte@3.52.0/node_modules/@sveltejs/kit/src/exports/vite/dev/index.js:340:66)
at respond (file:///C:/Src/my-demo-error/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.522_svelte@3.52.0/node_modules/@sveltejs/kit/src/runtime/server/index.js:287:40)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at file:///C:/Src/my-demo-error/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.522_svelte@3.52.0/node_modules/@sveltejs/kit/src/exports/vite/dev/index.js:410:22
Unexpected token 'export'
C:\Src\my-demo-error\node_modules\.pnpm\tslib@2.4.0\node_modules\tslib\tslib.es6.js:24
exportfunction__extends(d, b) {
^^^^^^
SyntaxError: Unexpected token 'export'
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1033:15)
at Module._compile (node:internal/modules/cjs/loader:1069:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:827:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Src\my-demo-error\node_modules\.pnpm\intl-messageformat@9.13.0\node_modules\intl-messageformat\index.js:8:15)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: