The problem
In the process of learning Vue3.0, I set up a project for in-depth study. NPM init vite-app
How did I introduce it at this point? (Highlight!! This is the wrong way to introduce it)
npm install qs --save-dev
But starting the project was an error
The requested module ‘/@modules/qs/lib/index.js’ does not provide an export named ‘default’
Puzzled later solved this problem with the help of big guy (here hang big nuggets account: Cherish553 can learn vue source code!)
The solution
The solution is to download the dependencies to the dependencies production environment. Run NPM uninstall QS to uninstall the dependencies and run NPM install QS to download the dependencies to the dependencies production environment
why
Vite is based on native ES modules, which requires that dependent modules be exported as export default and imported as import * from *. Let’s look at the difference between introducing dependencies in devDependencies and dependencies
DevDependencies Development environment
Dependencies Production Environment
< span style = “max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box! Important; word-wrap: break-word! Important;