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

Cannot read properties of undefined (reading '$i') #26

Open
hsb-tonmoy opened this issue Sep 8, 2022 · 7 comments
Open

Cannot read properties of undefined (reading '$i') #26

hsb-tonmoy opened this issue Sep 8, 2022 · 7 comments

Comments

@hsb-tonmoy
Copy link

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" />

500

Cannot read properties of undefined (reading '$i')

TypeError: Cannot read properties of undefined (reading '$i')
    at Function.w.extend (\node_modules\.pnpm\[email protected]\node_modules\dayjs\dayjs.min.js:1:6457)
    at /node_modules/.pnpm/[email protected]/node_modules/svelte-time/src/dayjs.js:1:26
    at async instantiateModule (/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-d66eb979.js:53333:9
@harvanchik
Copy link

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.

@harvanchik
Copy link

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\[email protected]\node_modules\dayjs\dayjs.min.js:1:6557)
      at eval (/node_modules/.pnpm/[email protected]/node_modules/svelte-time/src/dayjs.js:8:31)
      at async instantiateModule (file:///C:/Users/Me/Websites/case-play/node_modules/.pnpm/[email protected]/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\[email protected]\node_modules\dayjs\dayjs.min.js:1:6557)
    at /node_modules/.pnpm/[email protected]/node_modules/svelte-time/src/dayjs.js:4:7
    at async instantiateModule (file:///C:/Users/Me/Websites/case-play/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-3007b26d.js:52400:9)
9:58:23 AM [vite-plugin-svelte] ssr compile done.

@saturnonearth
Copy link

Any updates?

@metonym
Copy link
Owner

metonym commented Feb 27, 2023

Could you provide a repo containing a minimal reproduction of the issue? Happy to take a look.

@saturnonearth
Copy link

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.

@metonym
Copy link
Owner

metonym commented Mar 11, 2023

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 .

@saturnonearth
Copy link

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

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