vite build --mode=production react 'xx is not a function' error #14568
Replies: 2 comments 5 replies
-
lib: {
+ formats: ['es'],
}, |
Beta Was this translation helpful? Give feedback.
3 replies
-
all right, the build script for my component lib is mis-configurated. it was built in development mode |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
development mode
production mode
I got a react+ antd component lib, which used vite to build, in develop build mode, all works fine.
but in production mode, the above error will occur when I use the lib in my project.
it seems like jsx or react.createElement hasn't been bundled into the final index.js
the vite.config.ts for my common lib looks like this
I make the react external cause in my project, it has react, antd and other modules
any things I did wrong?
my project's package.json
my project's vite.config.ts
Beta Was this translation helpful? Give feedback.
All reactions