CommonJS issue with Styled Components on Build #18687
Replies: 2 comments
-
This is my vite.config.ts: `export default defineConfig({ // This changes the out put dir from dist to build plugins: [ |
Beta Was this translation helpful? Give feedback.
-
solved by adding to react-is to external roll-up options |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
Hi all -
I am getting an issue when building my app that I recently converted from CRA to VITE.
error during build: node_modules/styled-components/dist/styled-components.browser.esm.js (1:9): "typeOf" is not exported by "node_modules/react-is/index.js", imported by "node_modules/styled-components/dist/styled-components.browser.esm.js".
This only happens on build and I have tried all the commonJS options and plugins and nothing seems to fix it.
Please let me know!
Reproduction
Cannot deploy
Steps to reproduce
cannot deploy unfortunetly
System Info
Used Package Manager
npm
Logs
`error during build:
node_modules/styled-components/dist/styled-components.browser.esm.js (1:9): "typeOf" is not exported by "node_modules/react-is/index.js", imported by "node_modules/styled-components/dist/styled-components.browser.esm.js".
file: /Users/ashah/Desktop/bto_repos/bto_sample_management/node_modules/styled-components/dist/styled-components.browser.esm.js:1:9
1: import{typeOf as e,isElement as t,isValidElementType as n}from"react-is";import r,{useState as o,useContext as s,useM...
^
2: //# sourceMappingURL=styled-components.browser.esm.js.map
Validations
Beta Was this translation helpful? Give feedback.
All reactions