nuxt icon indicating copy to clipboard operation
nuxt copied to clipboard

After upgrading Nuxt 3.0.0 to 3.2.0 problem

Open regchiu opened this issue 2 years ago • 2 comments

Environment



Reproduction

  1. yarn upgrade nuxt --latest
  2. yarn dev
 ERROR  Cannot start nuxt:  Cannot find module 'postcss-custom-properties'
  1. Open nuxt.config.ts will see this on the colorMode property.
Argument of type '{ app: { head: { link: { rel: "icon"; type: "image/svg+xml"; href: string; }[]; }; }; typescript: { shim: false; strict: true; }; runtimeConfig: { apiSecret: string; public: { apiBase: string; }; }; modules: (string | [...])[]; colorMode: { ...; }; tailwindcss: { ...; }; }' is not assignable to parameter of type 'NuxtConfig'.
  Object literal may only specify known properties, and 'colorMode' does not exist in type 'NuxtConfig'.

Describe the bug

After upgrading nuxt 3.0.0 to 3.2.0, will see the problems.

  1. colorMode module option in nuxt 3.0.0 shows the type as
(property) NuxtConfig['colorMode']?: Partial<ModuleOptions> | undefined

but shows error in nuxt 3.2.0.

  1. We need to install postcss-custom-properties in nuxt 3.2.0, didn't need it in nuxt 3.0.0.

Additional context

No response

Logs

No response

regchiu avatar Feb 10 '23 01:02 regchiu

@regchiu Try upgrading @nuxtjs/tailwindcss to the latest and clear your caches.

Otherwise please create a reproduction repo

harlan-zw avatar Feb 10 '23 11:02 harlan-zw

The repo is here.

rep: https://github.com/regchiu/nuxt3-starter-template

Just run yarn upgrade nuxt --latest then run yarn dev, you can see:

  1. colorMode type error in nuxt.config.ts file. This doesn't affect program work, but typescript type error can be a bit annoying.

  1. postcss-custom-properties error. This does not need to be installed in nuxt 3.0.0 version.

SharedScreenshot2

So I need to upgrade all of nuxt module packages? thank you for your help.

regchiu avatar Feb 10 '23 15:02 regchiu

Yes try upgrading and then see what issues are left

harlan-zw avatar Feb 10 '23 23:02 harlan-zw

If this is not a nuxt 3.2.0 bug, I would like to close this issue. Thank you.

regchiu avatar Feb 11 '23 03:02 regchiu

did upgrading fix all the issues?

JokerMartini avatar Jan 09 '24 05:01 JokerMartini

did upgrading fix all the issues?

@JokerMartini Try nuxi upgrade --force.

regchiu avatar Jan 09 '24 06:01 regchiu