Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SyntaxError: Unexpected token export when trying to build SvelteKit

See original GitHub issue

I have ran into this error when trying to build my SvelteKit app:

`export { mathSsr as default }; ^^^^^^

SyntaxError: Unexpected token ‘export’ at Object.compileFunction (node:vm:352:18) at wrapSafe (node:internal/modules/cjs/loader:1031:15) at Module._compile (node:internal/modules/cjs/loader:1065:27) at Object.Module._extensions…js (node:internal/modules/cjs/loader:1153:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:196:29) at (node:internal/modules/esm/module_job:183:25) at async Loader.import (node:internal/modules/esm/loader:178:24) at async Promise.all (index 1) [SyntaxError: Unexpected token ‘export’] `

When I remove mathSsr the same error appears in gfm and other plugins. Is there any way to fix this? I am using the newest SvelteKit version.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:15 (13 by maintainers)

github_iconTop GitHub Comments

M4TYcommented, May 9, 2022

Yes, I am gonna do it right away.

pd4d10commented, May 9, 2022

Published v1.14.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unexpected token 'export' error when running SvelteKit dev ...
Using @carbon/charts in my SvelteKit app. When I run the dev server, I get this error: (node:64429) Warning: To load an ES module, ......
Read more >
SyntaxError: Unexpected token 'export' in JavaScript
The "Uncaught SyntaxError Unexpected token 'export'" occurs for 2 main reasons: Using the ES6 Module syntax in a Node.js application without type to...
Read more >
unexpected token "export" when importing a library -500 error
Hi Just started a new svelte-kit project. When importing my library - which loads a dependency library called Ionic, I get the error ......
Read more >
What does this vite error mean? SyntaxError: Unexpected ...
I was able to resolve this error myself. I found more specifics on the error when I ran npm run build instead of...
Read more >
unexpected token 'export' at object.compilefunction (node:vm ...
SyntaxError : Unexpected token 'export' when running mocha test ... I have ran into this error when trying to build my SvelteKit app:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found