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

[Nuxt Bridge] Build tries to import plugin without file format #387

Open
Tragio opened this issue Jan 23, 2022 · 1 comment
Open

[Nuxt Bridge] Build tries to import plugin without file format #387

Tragio opened this issue Jan 23, 2022 · 1 comment

Comments

@Tragio
Copy link

Tragio commented Jan 23, 2022

Hello 👋

Using the latest Nuxt Bridge and Nuxt DayJS set in buildModules and in devDependencies, with both Vite enabled and disabled.

I build nuxi build and start it nuxi start and I got immediately a critical error.

Cannot find module '/project/.output/server/node_modules/dayjs/plugin/relativeTime' imported from /project/.output/server/chunks/app/server.mjs
Did you mean to import dayjs/plugin/relativeTime.js?

The file is in that folder but it tries to import it without the file format.

https://github.com/nuxt-community/dayjs-module/blob/master/lib/plugin.js#L4

Just to test, I tried to add .js in that line and it fixed. However, I'm not sure if that is the correct behavior to define a specific file format. I think that maybe is there another underlying bug from Nuxt.

Thank you very much!

CC: @danielroe @potato4d

@thisismydesign
Copy link

This can be fixed by appending the missing extensions:
nuxt.config.ts

dayjs: {
  locales: ['en.js', 'de.js'],
  plugins: ['relativeTime.js'],
},

image

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

2 participants