svelte-time: SvelteKit build fails on dayjs ES module import not supported

Hi,

Thanks for this cool lib/component. It works great in dev mode for a Sveltekit project I am developping, but when running npm run build it fails with the following error :

Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import '/home/.../node_modules/dayjs/esm' is not supported resolving ES modules imported from /home/.../.svelte-kit/output/server/chunks/index-5e596d58.js
Did you mean to import dayjs/esm/index.js?
    at new NodeError (internal/errors.js:322:7)
    at finalizeResolution (internal/modules/esm/resolve.js:304:17)
    at moduleResolve (internal/modules/esm/resolve.js:731:10)
    at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:842:11)
    at Loader.resolve (internal/modules/esm/loader.js:89:40)
    at Loader.getModuleJob (internal/modules/esm/loader.js:242:28)
    at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:76:40)
    at link (internal/modules/esm/module_job.js:75:36)

Any idea how this could be fixed? šŸ™

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (9 by maintainers)

Commits related to this issue

Most upvoted comments

thanks @metonym ! To be honest I am not using this component anymore, so I’m not sure what to do with this issue! 😃 Should I close it, from what I can read I looks like it is fixed now, right?

Thank you very much @metonym for your time and effort.