-
Notifications
You must be signed in to change notification settings - Fork 106
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 find module 'vuetify/lib/util/colors' in nuxt.config.js #101
Comments
Hi @jscottsf ,
EDIT : Check my last comment Also, please update to the last version of the module (1.2.0) 😉 |
@jscottsf See this new option (if you upgrade the module to 1.2.0) : https://github.com/nuxt-community/vuetify-module#optionspath Defining options like this will make the Vuetify colors will be bundled by Webpack at build step, it should fix your issue. Ultimate solution would be moving |
Thank you for the fast reply. Yes, for the short term I moved I will definitely update and check out Thx! 👍 |
I feel like this should be more prominent in the README. So any user who does not dig in to the issues section will be blind to the issue until they try to do a production deployment. |
@morficus You're right but it's more likely |
@kevinmarrec fair point. |
@morficus Well AFAIK, |
@jscottsf hey brother, did you find solution for that missing package ? i am facing the same problem in nuxt/vuetify. |
Still not fixed by default. I got mine working using the above solutions:
|
Thnks! |
Using |
Can someone please reopen this issue. It is not fixed by default. I think making a new issue is counter-intuitive. @manniL you seem quite active on here. Are you able to help please? |
Reopened |
I'm having a same problem too hoping they have a fix for here. |
You need replace the "export default { ... }" to "module.exports = { ... }" |
This is the alternate solution that doesn't need
|
The simple solution to fix the problem without moving this dependency to dev. It perfectly works on javascript and typescript.
import colors from 'vuetify/src/util/colors'
import ru from 'vuetify/src/locale/ru'
export default {
lang: {
locales: { ru },
current: 'ru',
},
theme: {
dark: true,
themes: {
dark: {
primary: colors.blue.darken2,
accent: colors.grey.darken3,
secondary: colors.amber.darken3,
info: colors.teal.lighten1,
warning: colors.amber.base,
error: colors.deepOrange.accent4,
success: colors.green.accent3,
},
},
},
}
{
vuetify: {
customVariables: ['~/assets/variables.scss'],
optionsPath: '~/vuetify.options.ts',
},
// Build Configuration (https://go.nuxtjs.dev/config-build)
build: {
transpile: [/vuetify/],
},
} P.S. You can try to check it via a docker multi-staging build. FROM node:latest as builder
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn
COPY . ./
RUN yarn build
FROM node:alpine
WORKDIR /app
COPY package.json yarn.lock ./
ENV NODE_ENV=production
RUN yarn
COPY nuxt.config.js ./
COPY --from=builder /app/.nuxt ./.nuxt/
COPY --from=builder /app/static ./static/
EXPOSE 3000
ENV NUXT_HOST=0.0.0.0
ENTRYPOINT [ "yarn", "run" ]
CMD [ "start" ] |
I can develop the environment by converting docker base image |
Moving all @nuxtjs dependencies from devDependencies to dependencies helped. I don't understand why they were in dev in the first place. |
Still not fixed. Just created a fresh Nuxt project w/ Vuetify and it's busted when you deploy to production. 🤔 But many thanks to @MarkSonn for the easy & quick fix! |
Fix this error: Cannot find module 'vuetify/es5/util/colors' in /nuxt.config.js More info: nuxt-community/vuetify-module#101 (comment)
Hi I am having same issue when I try to deploy site on netlify but its working fine on my local machine. Here is my package.json { |
hello guys, I tried moving the @nuxtjs/vuetify module to the dependency from devDependency, it works quite well on netlify but on digital ocean provisioned server I have it gives me an error still stating |
It worked for me. I think this is the best solution. Thanks a lot! 👏🏼 |
It sill an issue for me, I try to move from devDependencies to dependencies, try to use |
I'm not sure if it is a good practice but setting NPM_CONFIG_PRODUCTION=false before install solved the issue for me. This tell npm to install also devDependencies. btw I'm using an old version of nuxt, maybe is not needed anymore:
My multistage Dockerfile:
|
I'm seeing this problem in vite+typescript-based vuetify 3 project. I'm using latest vue and vuetify. Also vite adds vuetify to
Interestingly, |
+1 to @Shujee comment. I have the same setup vite, TS, vue3, vuetify3, and I'm seeing the same behavior. TS complains about the import path, but all of the colors resolve. |
Module version
1.0.2
Describe the bug
Production app throws
Cannot find module 'vuetify/lib/util/colors' in nuxt.config.js.
To Reproduce
Specify the following in next.config.js for custom colors:
Works in dev since the dev dependencies are available. If you build for production in a Docker container, throws the error
Cannot find module 'vuetify/lib/util/colors'
since dev dependencies are not loaded when NODE_ENV is production.The text was updated successfully, but these errors were encountered: