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

Sveltekit and SSR crash #101

Open
Patrickkpic opened this issue Sep 16, 2021 · 4 comments
Open

Sveltekit and SSR crash #101

Patrickkpic opened this issue Sep 16, 2021 · 4 comments

Comments

@Patrickkpic
Copy link

Does not work with Sveltekit and SSR (even with SPA mode: static-adapter).
It simply crashes the page

Logs
on the page:
500
Failed to fetch dynamically imported module: http://localhost:3000/src/routes/about.svelte?t=1631803862284
TypeError: Failed to fetch dynamically imported module: http://localhost:3000/src/routes/about.svelte?t=1631803862284

in the terminal:
16:45:40 [vite] Error when evaluating SSR module /Users/xxx/projects/xxx/src/routes/about.svelte:

Error: failed to load module for ssr: /node_modules/svelte-inclusive-datepicker/src/index.js
at instantiateModule (/Users/xxx/projects/xxx/node_modules/vite/dist/node/chunks/dep-98dbe93b.js:73805:15)
failed to load module for ssr: /node_modules/svelte-inclusive-datepicker/src/index.js

To Reproduce
Install basic Sveltekit project
follow the install instructions here and choose date-fns

import { DatePicker } from 'svelte-inclusive-datepicker';
in a random .svelte route

@hmiiro
Copy link

hmiiro commented Oct 29, 2021

same issue here! even if you use dayjs! any help?

@leetrout
Copy link

Similar error

6:16:29 PM [vite] Error when evaluating SSR module /node_modules/date-fns/locale/en-US/index.js?v=e6530e82:
ReferenceError: exports is not defined
    at /node_modules/date-fns/locale/en-US/index.js?v=e6530e82:3:23
    at instantiateModule (/home/user/code/github.com/10trinsic/10trinsic.com/node_modules/vite/dist/node/chunks/dep-4b9dfa16.js:60093:15)
    ```

@leetrout
Copy link

Probably related to vitejs/vite#2579

@andrew-secret
Copy link
Owner

Apologies for the delayed response. It seems though this issue vitejs/vite#2579 might be related. Otherwise, you are welcome to create a pull request. I'll try to look into it.

First thing first, I'll update all the dependencies and close those open Dependabot PR's. Makes my happy to see that people actually using this and starting to contribute to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants