Skip to content

Error when evaluating SSR module (Unexpected token 'export') in DEV #2914

Description

@livehtml

Describe the bug

When I run pnpm run dev and load some page I've got an error in console:

3:53:23 PM [vite] Error when evaluating SSR module /.svelte-kit/dev/runtime/internal/singletons.js:
SyntaxError: Unexpected token 'export'
    at new AsyncFunction (<anonymous>)
    at instantiateModule (/home/www/sources/node_modules/.pnpm/vite@2.6.14_sass@1.43.5/node_modules/vite/dist/node/chunks/dep-e0fe87f8.js:66543:28)
3:53:23 PM [vite] Error when evaluating SSR module /.svelte-kit/dev/runtime/app/navigation.js:
SyntaxError: Unexpected token 'export'
    at new AsyncFunction (<anonymous>)
    at instantiateModule (/home/www/sources/node_modules/.pnpm/vite@2.6.14_sass@1.43.5/node_modules/vite/dist/node/chunks/dep-e0fe87f8.js:66543:28)
3:53:23 PM [vite] Error when evaluating SSR module /src/lib/Components/Base/LoginPopup.svelte:
SyntaxError: Unexpected token 'export'
    at new AsyncFunction (<anonymous>)
    at instantiateModule (/home/www/sources/node_modules/.pnpm/vite@2.6.14_sass@1.43.5/node_modules/vite/dist/node/chunks/dep-e0fe87f8.js:66543:28)
3:53:23 PM [vite] Error when evaluating SSR module /src/routes/__layout.svelte:
SyntaxError: Unexpected token 'export'
    at new AsyncFunction (<anonymous>)
    at instantiateModule (/home/www/sources/node_modules/.pnpm/vite@2.6.14_sass@1.43.5/node_modules/vite/dist/node/chunks/dep-e0fe87f8.js:66543:28)
Unexpected token 'export'
SyntaxError: Unexpected token 'export'
    at new AsyncFunction (<anonymous>)
    at instantiateModule (/home/www/sources/node_modules/.pnpm/vite@2.6.14_sass@1.43.5/node_modules/vite/dist/node/chunks/dep-e0fe87f8.js:66543:28)

But if I reload the page — no more errors until I again restart dev.

Reproduction

I can't tell exaclty why and when in happens, but looks like it's an error from packages. Probably after updating dependencies few days ago.

System Info

System:
    OS: Linux 5.4 Ubuntu 20.04.3 LTS (Focal Fossa)
    CPU: (2) x64 DO-Regular
    Memory: 249.28 MB / 3.84 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 16.13.0 - /usr/bin/node
    npm: 8.1.0 - /usr/bin/npm
  npmPackages:
    @sveltejs/adapter-node: ^1.0.0-next.55 => 1.0.0-next.55 
    @sveltejs/adapter-static: ^1.0.0-next.21 => 1.0.0-next.21 
    @sveltejs/kit: next => 1.0.0-next.200 
    svelte: ^3.44.2 => 3.44.2

Severity

serious, but I can work around it

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    p3-edge-caseSvelteKit cannot be used in an uncommon wayvite

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions