userquin / vuetify-nuxt-module

Zero-config Nuxt Module for Vuetify
https://vuetify-nuxt-module.netlify.app/
MIT License
190 stars 20 forks source link

ExperimentalWarning after update to 0.8.0 #177

Open Tennyleaz opened 6 months ago

Tennyleaz commented 6 months ago

I updated from 0.7.3 to 0.8.0, and get this npm warning at nuxt prepare/debug/build time:

 ERROR  (node:11982) ExperimentalWarning: Import assertions are not a stable feature of the JavaScript language. Avoid relying on their current behavior and syntax as those might change in a future version of Node.js. 
(Use node --trace-warnings ... to show where the warning was created)

 ERROR  (node:11982) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time

This is my project info:

$ npx nuxi info
Working directory: /home/leaz/workspace/my-project                                                                                                                                                                                             
Nuxt project info:                                                                                                                                                                                                                            
------------------------------
- Operating System: Linux
- Node Version:     v20.9.0
- Nuxt Version:     3.9.0
- CLI Version:      3.10.0
- Nitro Version:    2.8.1
- Package Manager:  npm@10.2.5
- Builder:          -
- User Config:      devtools, app, css, modules, i18n, runtimeConfig
- Runtime Modules:  vuetify-nuxt-module@0.8.0, @pinia/nuxt@0.5.1, @nuxtjs/i18n@8.0.0
- Build Modules:    -
------------------------------

I would stick to 0.7.3 for now...

userquin commented 6 months ago

I've sent DM to Kael a few days ago in nuxt discord channel (vuetify server): https://discord.com/channels/340160225338195969/696761883184595004/1189259211662708806

The change in vuetify vite plugin 2.0.1: https://github.com/vuetifyjs/vuetify-loader/blob/master/packages/shared/src/imports/getImports.ts#L2-L3

davidstackio commented 6 months ago

I'm also getting this error.

Related PR: https://github.com/vuetifyjs/vuetify-loader/pull/327

Nuxt project info:                                                                                                                                                                                                                                                     12:22:08 PM

------------------------------
- Operating System: Windows_NT
- Node Version:     v18.19.0
- Nuxt Version:     3.9.0
- CLI Version:      3.10.0
- Nitro Version:    2.8.1
- Package Manager:  npm@10.2.1
- Builder:          -
- User Config:      extends, nitro, modules, content, runtimeConfig
- Runtime Modules:  @nuxt/content@2.10.0, @pinia/nuxt@0.5.1
- Build Modules:    -
------------------------------
kingyue737 commented 6 months ago

Not planned 😭 https://github.com/vuetifyjs/vuetify-loader/issues/326

I wonder if we can catch or suppress the console warning from Node. I also failed to find a way to add Node option in CLI like --trace-warnings when using with Vite.

kingyue737 commented 5 months ago

We cannot pass arguments to Node in pnpm-scripts https://github.com/pnpm/pnpm/issues/2097 . Instead, we can pass option via the NODE_OPTIONS env variable:

{
  "scripts": {
    "dev": "cross-env NODE_OPTIONS='--no-warnings=ExperimentalWarning' nuxt dev -o",
    "build": "cross-env NODE_OPTIONS='--no-warnings=ExperimentalWarning' nuxt build",
  },
}

This workaround is a little ugly since we need to add env before every script which runs nuxt.

kingyue737 commented 4 months ago

This can be closed as fixed in vite-plugin-vuetify v2.0.3

davidstackio commented 1 month ago

Yes, looks like it is working as of vite-plugin-vuetify v2.0.3.