carbonplan / maps

interactive multi-dimensional data-driven web maps
https://maps.demo.carbonplan.org
Other
212 stars 18 forks source link

Theme-ui dependencly error - [useColorMode] requires the ColorModeProvider component #116

Open Bluesmile82 opened 5 months ago

Bluesmile82 commented 5 months ago

I tried to run the simple-maps-demo repo on node version 14.21.3. But I have an error when running yarn dev:

error - Error: [useColorMode] requires the ColorModeProvider component at Object.useColorMode (/Users/alvaroleal/code/vizzuality/simple-map-demo/node_modules/@carbonplan/colormaps/node_modules/@theme-ui/color-modes/dist/theme-ui-color-modes.cjs.dev.js:250:11) at useColormap (/Users/alvaroleal/code/vizzuality/simple-map-demo/node_modules/@carbonplan/colormaps/dst/index.js:392:31) at Index (webpack-internal:///./pages/index.js:17:86) at processChild (/Users/alvaroleal/code/vizzuality/simple-map-demo/node_modules/react-dom/cjs/react-dom-server.node.development.js:3353:14) at resolve (/Users/alvaroleal/code/vizzuality/simple-map-demo/node_modules/react-dom/cjs/react-dom-server.node.development.js:3270:5) at ReactDOMServerRenderer.render (/Users/alvaroleal/code/vizzuality/simple-map-demo/node_modules/react-dom/cjs/react-dom-server.node.development.js:3753:22) at ReactDOMServerRenderer.read (/Users/alvaroleal/code/vizzuality/simple-map-demo/node_modules/react-dom/cjs/react-dom-server.node.development.js:3690:29) at Object.renderToString (/Users/alvaroleal/code/vizzuality/simple-map-demo/node_modules/react-dom/cjs/react-dom-server.node.development.js:4298:27) at Object.renderPage (/Users/alvaroleal/code/vizzuality/simple-map-demo/node_modules/next/dist/server/render.js:596:45) at Function.getInitialProps (webpack-internal:///./node_modules/next/dist/pages/_document.js:194:19) { page: '/' }

At first I thought the problem was using a more recent version of Next or the apps directory. But I ran this project as it is and I also get the error. Any help?

Shane98c commented 2 weeks ago

We haven't been able to reproduce this unfortunately. We've seen similar issues in the past when using local linking, but it doesn't seem like that's the issue here. I'm able to get the demo running with a fresh install with the following series of commands (tried a couple different node versions):

npm i
npm run dev

Let us know if you're still seeing the issue!