codecks-io/react-sticky-box

typeError when build in docker

Closed this issue · 2 comments

This error only appeared in Docker environment

TypeError: Cannot read properties of null (reading 'useState')
2023-05-17 18:22:51     at exports.useState (/app/node_modules/react/cjs/react.production.min.js:25:394)
2023-05-17 18:22:51     at useStickyBox (file:///app/node_modules/react-sticky-box/dist/index.js:239:27)
2023-05-17 18:22:51     at StickyBox (file:///app/node_modules/react-sticky-box/dist/index.js:252:15)
2023-05-17 18:22:51     at Ge (/app/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:114:273)
2023-05-17 18:22:51     at Z (/app/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:120:91)
2023-05-17 18:22:51     at He (/app/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:123:155)
2023-05-17 18:22:51     at Ge (/app/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:115:215)
2023-05-17 18:22:51     at Z (/app/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:120:91)
2023-05-17 18:22:51     at He (/app/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:123:155)
2023-05-17 18:22:51     at Je (/app/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:122:100)

You need to provide more context. What are you using for bundling? As you can see here the required file doesn't do anything unusual when importing useState from react.

I use the umi.js only appeared in production environment