I have a problem with react-datepicker #781
Replies: 1 comment
-
Make sure to pass components to React and not something else. Note that, because of CJS-ESM compatibility, it isn't unusual to end up with different imports depending on dev/build. That could be a reason. See https://vite-plugin-ssr.com/common-issues#libraries-containing-invalid-esm. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I don't know if anyone has the same problem as me.
My Lib:
"@hookform/resolvers": "^3.0.1", "@reduxjs/toolkit": "^1.9.3", "axios": "^1.3.5", "bcryptjs": "^2.4.3", "bootstrap": "^5.2.3", "cookie-parser": "^1.4.6", "cors": "^2.8.5", "date-fns": "^2.29.3", "dotenv": "^16.0.3", "express": "^4.18.2", "joi": "^17.9.1", "js-cookie": "^3.0.1", "jsonwebtoken": "^9.0.0", "mime-types": "^2.1.35", "multer": "^1.4.5-lts.1", "nodemon": "^2.0.22", "pg": "^8.10.0", "pg-hstore": "^2.3.4", "randomstring": "^1.2.3", "react": "^18.2.0", "react-bootstrap": "^2.7.3", "react-datepicker": "^4.11.0", "react-dom": "^18.2.0", "react-hook-form": "^7.43.9", "react-icons": "^4.8.0", "react-redux": "^8.0.5", "react-toastify": "^9.1.2", "sass": "^1.62.0", "sequelize": "^6.31.0", "sirv": "^2.0.2", "swiper": "^9.2.0", "vite": "^4.2.1", "vite-plugin-ssr": "^0.4.112", "yup": "^1.1.0"
Run for dev:
ts-node --experimental-specifier-resolution=node ./server/index.ts
, it run normoal.When i build and run:
vite build
cross-env NODE_ENV=production ts-node --experimental-specifier-resolution=node ./server/index.ts
i have a problem with
react-datepicker
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
Please help me.
Thank you so much.
Beta Was this translation helpful? Give feedback.
All reactions