Skip to content
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

Error when evaluating SSR module in dev mode #3520

Closed
matheussouza9 opened this issue Jan 24, 2022 · 1 comment
Closed

Error when evaluating SSR module in dev mode #3520

matheussouza9 opened this issue Jan 24, 2022 · 1 comment
Labels

Comments

@matheussouza9
Copy link

matheussouza9 commented Jan 24, 2022

Describe the bug

Using sveltekit at 1.0.0-next.240 version, I get the following error with youtube-player package when the page loads for the first time in dev server. In production preview server it's working.

image

[vite] Error when evaluating SSR module /node_modules/.pnpm/youtube-player@5.5.2/node_modules/youtube-player/dist/index.js?v=70c987a9:
ReferenceError: exports is not defined
    at /node_modules/.pnpm/youtube-player@5.5.2/node_modules/youtube-player/dist/index.js?v=70c987a9:3:23
    at instantiateModule (/home/matheus/meetacity/node_modules/.pnpm/vite@2.7.13/node_modules/vite/dist/node/chunks/dep-f5552faa.js:60105:15)

But, when I refresh the page, it works.

image

Reproduction

  • Install svelte-youtube package
  • Create a simple page like this one below
<script>
    import YouTube from 'svelte-youtube'
</script>

<YouTube videoId='uQntFkK8Z54'/>
  • Run npm run dev -- --open
  • Go to that page and see the error
  • Refresh the page and it works

Logs

No response

System Info

System:
    OS: Linux 5.10 Ubuntu 20.04.3 LTS (Focal Fossa)
    CPU: (12) x64 AMD Ryzen 5 2600 Six-Core Processor
    Memory: 3.37 GB / 5.79 GB
    Container: Yes
    Shell: 3.3.1 - /usr/bin/fish
Binaries:
    Node: 16.13.2 - /tmp/fnm_multishells/1514_1642986568258/bin/node
    Yarn: 1.22.17 - /tmp/fnm_multishells/128_1642985412126/bin/yarn
    npm: 8.1.2 - /tmp/fnm_multishells/1514_1642986568258/bin/npm
npmPackages:
    @sveltejs/adapter-auto: next => 1.0.0-next.14 
    @sveltejs/kit: next => 1.0.0-next.240 
    svelte: ^3.44.0 => 3.46.2

Severity

annoyance

Additional Information

No response

@bluwy
Copy link
Member

bluwy commented Jan 24, 2022

Sounds like vitejs/vite#2579. Unfortunately there isn't much SvelteKit can do, other than having this fixed in Vite, so I'll close this in favour of that.

@bluwy bluwy closed this as completed Jan 24, 2022
@bluwy bluwy added the vite label Jan 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants