#Cannot read properties of null (reading 'useState') - everytime there's dependency changes

1 messages · Page 1 of 1 (latest)

trim light
#

Hi, I've been using Remix for almost 10 months now. However, after moving to vite, and even using the newest remix template with vite, Everytime I have a new dependency change. Navigating to some page would show this error.

Application Error
TypeError: Cannot read properties of null (reading 'useMemo')
at Object.useMemo (http://localhost:3000/node_modules/.vite/deps/chunk-PW5ESXJ3.js?v=e9cfd96e:1094:29)
at useScope (http://localhost:3000/node_modules/.vite/deps/@radix-ui_react-popover.js?v=fe1fa0f0:102:21)
at Popover (http://localhost:3000/node_modules/.vite/deps/@radix-ui_react-popover.js?v=fe1fa0f0:1512:23)
at renderWithHooks (http://localhost:3000/node_modules/.vite/deps/chunk-RXX2RYKY.js?v=4a8bfba4:11548:26)
at mountIndeterminateComponent (http://localhost:3000/node_modules/.vite/deps/chunk-RXX2RYKY.js?v=4a8bfba4:14926:21)
at beginWork (http://localhost:3000/node_modules/.vite/deps/chunk-RXX2RYKY.js?v=4a8bfba4:15914:22)
at beginWork$1 (http://localhost:3000/node_modules/.vite/deps/chunk-RXX2RYKY.js?v=4a8bfba4:19753:22)
at performUnitOfWork (http://localhost:3000/node_modules/.vite/deps/chunk-RXX2RYKY.js?v=4a8bfba4:19198:20)
at workLoopSync (http://localhost:3000/node_modules/.vite/deps/chunk-RXX2RYKY.js?v=4a8bfba4:19137:13)
at renderRootSync (http://localhost:3000/node_modules/.vite/deps/chunk-RXX2RYKY.js?v=4a8bfba4:19116:15)

and eventually refresh itself with the correct page. This only happens whenever I have new changes in the dependency.

unkempt tree
trim light
#

Hi @unkempt tree Thank so much for the reply. I've been struggling on this, everytime I ran into this, I try to solve it but end up with the same problem, even if I try the latest version. Not sure why I don't see many complaints about this. I'll try to search through the github issue for this. Will try the flag as wel. Cheers!

trim light
#

Thanks for triggering my curiosity again with that answer, eventually start reading the future flag docs and start searching from there.

I found someone suggested in the github issues

server: {
warmup: {
clientFiles: ["app/**/*.tsx"],
},
}

This somehow prevented the issue.