Open hsb-tonmoy opened 1 year ago
I also receive this error, and it's inconsistent. The app works fine for a few minutes, but then it suddenly breaks later when nothing changed regarding the Time.
9:58:22 AM [vite-plugin-svelte] ssr compile in progress ...
Internal server error: Cannot read properties of undefined (reading '$i')
at Function.w.extend (C:\Users\Me\Websites\case-play\node_modules\.pnpm\dayjs@1.11.7\node_modules\dayjs\dayjs.min.js:1:6557)
at eval (/node_modules/.pnpm/svelte-time@0.7.1/node_modules/svelte-time/src/dayjs.js:8:31)
at async instantiateModule (file:///C:/Users/Me/Websites/case-play/node_modules/.pnpm/vite@4.1.1/node_modules/vite/dist/node/chunks/dep-3007b26d.js:52400:9)
TypeError: Cannot read properties of undefined (reading '$i')
at Function.w.extend (C:\Users\Me\Websites\case-play\node_modules\.pnpm\dayjs@1.11.7\node_modules\dayjs\dayjs.min.js:1:6557)
at /node_modules/.pnpm/svelte-time@0.7.1/node_modules/svelte-time/src/dayjs.js:4:7
at async instantiateModule (file:///C:/Users/Me/Websites/case-play/node_modules/.pnpm/vite@4.1.1/node_modules/vite/dist/node/chunks/dep-3007b26d.js:52400:9)
9:58:23 AM [vite-plugin-svelte] ssr compile done.
Any updates?
Could you provide a repo containing a minimal reproduction of the issue? Happy to take a look.
It has something to do with the dayjs not being optimized on build. I could not replicate this in a Stackblitz. I fixed it buy manually installing dayjs as a dependency.
It has something to do with the dayjs not being optimized on build.
Interesting – are you also using pnpm like the OP? It might be worth specifying the docs that pnpm users must also install dayjs .
It has something to do with the dayjs not being optimized on build.
Interesting – are you also using pnpm like the OP? It might be worth specifying the docs that pnpm users must also install dayjs .
Yes I am using pnpm
I'm using the latest release of Sveltekit and I've installed svelte-time as a dev dependency. I'm getting this error at the most basic usage of the module:
<Time relative timestamp="2020-02-01" />