[vite 3.0.7] Vue is not correctly imported in production
See original GitHub issueDescribe the bug
I import vue and a 3rd package portal-vue. It works fine in dev, but raises the following error if I preview the bundle built:
Vue.extend is not a function
This bug looks very similar to an issue vitejs/vite-plugin-vue#34 I reported previously but occurs only since v3.0.6.
✔️Vite v3.0.5 dev ✔️Vite v3.0.5 production ✔️Vite v3.0.6 v3.0.7 dev ❌Vite v3.0.6 v3.0.7 production
Reproduction
https://stackblitz.com/edit/vitejs-vite-e9wniz
System Info
System:
OS: Linux 5.0 undefined
CPU: (4) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 16.14.2 - /usr/local/bin/node
Yarn: 1.22.10 - /bin/yarn
npm: 7.17.0 - /bin/npm
npmPackages:
vite: ^3.0.7 => 3.0.7
Used Package Manager
pnpm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it’s a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Troubleshooting - Vite
As Vite does not bundle most of the files, browsers may request many files which require many file ... You may be importing...
Read more >Vue 3 - Vite app missing some CSS rules after build
When building for production, it removes CSS rules that are not being used. There are some libraries that concatenate CSS class names using ......
Read more >Vite JS – The Installation Guide - Radixweb
Want to install ViteJS into your system? Here is a detailed installation guide on how to install Vite JS in your preferred environment....
Read more >Migrating From Vue-CLI & Webpack to Vitejs - Boot.dev
Vite explicitly requires that all .vue imports include the .vue in the path. This can be a bit tedious if you haven't been...
Read more >The missing migration guide: from Vue CLI to Vite - Moiva.io
Hence style definitions for classes from that file were not included in the production build. The problem was fixed easily by tweaking the ......
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 Free
Top 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

Thanks for the patch! fixed in 3.0.8
Likely fixed by https://github.com/vitejs/vite/pull/9653, pending a new patch release