Comments (4)
https://github.com/antfu/unplugin-auto-import/blob/main/src/presets/react.ts has contains the project custom auto-import https://github.com/yunsii/vite-react/blob/master/vite.config.ts#L27
So, you can use autoImport
plugin directly without custom imports
from vite-react.
Nonetheless I was cloning without significant modification, ran into runtime error finally.
I was wondering why this would happen.
failed to load config from /Users/_____/foodSDU/vite.config.ts
error when starting dev server:
Error: [auto-import] identifier useImperativeHandle already defined with react
at /Users/_____/foodSDU/node_modules/.pnpm/[email protected][email protected]/node_modules/unplugin-auto-import/dist/chunk-KSE6FVK6.js:63:17
at Array.forEach (<anonymous>)
at flattenImportsMap (/Users/_____/foodSDU/node_modules/.pnpm/[email protected][email protected]/node_modules/unplugin-auto-import/dist/chunk-KSE6FVK6.js:42:36)
at resolveOptions (/Users/_____/foodSDU/node_modules/.pnpm/[email protected][email protected]/node_modules/unplugin-auto-import/dist/chunk-KSE6FVK6.js:18:19)
at /Users/_____/foodSDU/node_modules/.pnpm/[email protected][email protected]/node_modules/unplugin-auto-import/dist/chunk-KSE6FVK6.js:235:18
at /Users/_____/foodSDU/node_modules/.pnpm/[email protected][email protected]/node_modules/unplugin/dist/index.js:965:23
at Object.<anonymous> (/Users/_____/foodSDU/vite.config.ts:97:29)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.require.extensions.<computed> [as .ts] (/Users/_____/foodSDU/node_modules/.pnpm/[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-c9998dc6.js:61998:20)
at Module.load (node:internal/modules/cjs/loader:981:32)
ELIFECYCLE Command failed with exit code 1.
from vite-react.
Using pnpm
might cause the error.
I've turned to yarn
and added two peer deps
prop-types@^15.5.7
rollup@^2.0.0
This fixed the problem. Thank you.
from vite-react.
Yep, the project has yarn.lock
, use yarn
will be ok.
from vite-react.
Related Issues (6)
- 怎么使用path-to-regexp插件 HOT 4
- concent 升级到 v2.16.7 编译后报错 HOT 2
- LoadingComponent path error HOT 3
- How to add <ConfigProvider>? HOT 4
- 项目运行错误 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vite-react.