Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Bluesmile82 opened this issue Jun 7, 2024 · 1 comment

Comments

@Bluesmile82
Copy link

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
Copy link
Member

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants