vuetifyjs / nuxt-module

Zero-config Nuxt Module for Vuetify
https://nuxt.vuetifyjs.com/
MIT License
209 stars 21 forks source link

ERROR Internal server error: Cannot destructure property 'from' of 'importMapLabComponents[component]' as it is undefined. #153

Closed sdr0x07b6 closed 10 months ago

sdr0x07b6 commented 10 months ago
% yarn nuxi info

------------------------------
- Operating System: Darwin
- Node Version:     v18.18.0
- Nuxt Version:     3.8.1
- CLI Version:      3.9.1
- Nitro Version:    2.7.2
- Package Manager:  yarn@1.22.19
- Builder:          -
- User Config:      ssr, devtools, srcDir, modules, imports, runtimeConfig, app, vuetify, vite, nitro
- Runtime Modules:  vuetify-nuxt-module@0.6.6, nuxt-icon@0.6.5, @vueuse/nuxt@10.6.0, @pinia/nuxt@0.5.1, @nuxtjs/supabase@1.1.3, @pinia-plugin-persistedstate/nuxt@1.2.0, @nuxtjs/i18n@8.0.0-rc.5, @vee-validate/nuxt@4.11.8
- Build Modules:    -
------------------------------

Error message during startup with yarn dev.

ERROR Cannot destructure property 'from' of 'importMapLabComponents[component]' as it is undefined.

There is no other message in the terminal, so I do not know what is going on. However, when I access the browser afterwards, the stack trace is also displayed, and it appears that the vuetify-nuxt-module is the cause.

Cannot destructure property 'from' of 'importMapLabComponents[component]' as it is undefined.
    at file://node_modules/vuetify-nuxt-module/dist/module.mjs:880:17
    at Array.forEach (<anonymous>)
    at buildConfiguration (file://node_modules/vuetify-nuxt-module/dist/module.mjs:879:24)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Context.load (file://node_modules/vuetify-nuxt-module/dist/module.mjs:760:24)
    at async file://node_modules/vite-plugin-inspect/dist/index.mjs:402:17
    at async Object.load (file://node_modules/vite/dist/node/chunks/dep-bb8a8339.js:44323:32)
    at async loadAndTransform (file://node_modules/vite/dist/node/chunks/dep-bb8a8339.js:54954:24)
    at async viteTransformMiddleware (file://node_modules/vite/dist/node/chunks/dep-bb8a8339.js:64430:32

The application is currently unavailable. It was fine until the other day; I think the problem occurred at the time I updated the vuetify-nuxt-module. I have not made any configuration changes to Vuetify in the meantime.

Strangely enough, the error did not stop after lowering the version of vuetify-nuxt-module one by one to 0.6.5, 0.6.4, ..., 0.6.0. , I thought it was possible that the version of Vuetify on which it depends had changed, so I reverted to v3.3.23 and the error disappeared.

package.json

    "vuetify": "3.3.23",
    "vuetify-nuxt-module": "0.6.4",

Is this an issue that can be addressed on the vuetify-nuxt-module side? The changelog for vuetify-nuxt-module v0.6.6 says "Add support for Vuetify 3.4". Is this the point?


After fixing the version as above, the error on startup has subsided. However, when I access the browser, there is an error that did not occur before.

[plugin:vite:import-analysis] Failed to resolve import "vuetify/lib/components/VDataTable/index.mjs" from "src/components/partials/publications/Notices.vue". Does the file exist?
src/components/partials/publications/Notices.vue:139:69
137|  /* Vuetify */
138|  import { VBtn as _component_v_btn } from "vuetify/lib/components/VBtn/index.mjs"
139|  import { VDataTableServer as _component_v_data_table_server } from "vuetify/lib/components/VDataTable/index.mjs"
   |                                                                      ^
140|  
141|
    at formatError (file://node_modules/vite/dist/node/chunks/dep-bb8a8339.js:44062:46)
    at TransformContext.error (file://node_modules/vite/dist/node/chunks/dep-bb8a8339.js:44058:19)
    at normalizeUrl (file://node_modules/vite/dist/node/chunks/dep-bb8a8339.js:41844:33)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file://node_modules/vite/dist/node/chunks/dep-bb8a8339.js:41998:47
    at async Promise.all (index 10)
    at async TransformContext.transform (file://node_modules/vite/dist/node/chunks/dep-bb8a8339.js:41914:13)
    at async file://node_modules/vite-plugin-inspect/dist/index.mjs:372:17
    at async Object.transform (file://node_modules/vite/dist/node/chunks/dep-bb8a8339.js:44352:30)
    at async loadAndTransform (file://node_modules/vite/dist/node/chunks/dep-bb8a8339.js:55026:29)
    at async viteTransformMiddleware (file://node_modules/vite/dist/node/chunks/dep-bb8a8339.js:64430:32

Is this relevant?

vuetify.config.ts

export default defineVuetifyConfiguration({
  labComponents: ['VDataTableServer'],

In the editor, the 'VDataTableServer' is redlined to indicate an error. Type '"VDataTableServer"' cannot be assigned to types '"VConfirmEdit" | "VPicker" | "VPickerTitle"'. ts(2322)

Until the other day, I don't think this was an error either.

mtdvlpr commented 10 months ago

@sdr0x07b6, the VDataTableServer is no longer in labs since Vuetify 3.4, so you don't need to explicitly import in your config anymore. You can remove the labComponents: ['VDataTableServer'],

sdr0x07b6 commented 10 months ago

I see! I didn't know there was such a change. I removed the line labComponents:['VDataTableServer'], and it works fine. @mtdvlpr Thanks!