vite: vue is undefined in runtime
See original GitHub issueEnvironment
- Operating System:
Linux
- Node Version:
v16.15.1
- Nuxt Version:
2.16.0-27720022.54e852f
- Nitro Version:
0.5.4
- Package Manager:
npm@8.13.2
- Builder:
vite
- User Config:
bridge
,build
,buildModules
,vuetify
,serverHandlers
,devServerHandlers
- Runtime Modules:
-
- Build Modules:
()
,@nuxtjs/vuetify@1.12.3
,@nuxt/bridge@0.10.1
Reproduction
https://github.com/AndreyYolkin/nuxt-vuetify-issue (better explained) https://github.com/AndreyYolkin/nuxtjs-vuetify (with @nuxtjs/vuetify)
Describe the bug
For some reasons files that use Vue
import in undefined at runtime. I’ve got this problem trying to make vuetify 2 work with latest bridge versions.
Additional context
No response
Logs
entry.mjs:100 TypeError: Cannot read properties of undefined (reading 'observable')
at Vue.<anonymous> (index.ts:239:23)
at Vue.on (vue.runtime.esm.js?v=6c5bc416:3655:16)
at invokeWithErrorHandling (vue.runtime.esm.js?v=6c5bc416:3015:30)
at Vue.$emit (vue.runtime.esm.js?v=6c5bc416:3714:17)
at callHook$1 (vue.runtime.esm.js?v=6c5bc416:4033:12)
at Vue._init (vue.runtime.esm.js?v=6c5bc416:5678:9)
at new Vue (vue.runtime.esm.js?v=6c5bc416:5747:10)
at mountApp (entry.mjs:737:16)
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Vue 3 + Vite image URL becomes undefined after build
I encountered a bug where I dynamically generated a URL from props for image import in my Vue 3 component and it becomes...
Read more >Configuring Vite
The value could be undefined for tools that don't have separate commands for the browser and SSR build, so use explicit comparison against...
Read more >TypeScript with Composition API - Vue.js
This is called "runtime declaration", because the argument passed to defineProps() will ... inferred type: Ref<number | undefined> const n = ref<number>() ...
Read more >vite uncaught referenceerror: require is not defined - You.com
There should never be require in source code when using Vite. It's ESM only. edit your app.js to import .vue files.
Read more >[Vue 3 & Vite 2] Uncaught (in promise) TypeError: Cannot read ...
After a day of searching, I came close to understand that while 'loading' is true, the function won't return anything so it is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://github.com/AndreyYolkin/nuxt-vuetify-issue/blob/master/nuxt.config.ts#L10 https://github.com/AndreyYolkin/nuxtjs-vuetify/blob/master/nuxt.config.ts#L8
Yes, I tried, and still have troubles
+1 on this. I traced this to default export being deliberately removed in esbuild’s
__reExport
.Related issue: https://github.com/evanw/esbuild/issues/1737
I ended up with a bunch of pnpm patches:
{ Vue }
fromvue
itself{ Vue } from 'vue'
in the affected librariesand then like: