grommet / grommet-cli

Deprecated, use create-react-app for v2 instead. Command Line interface for grommet
Apache License 2.0
28 stars 18 forks source link

Countless errors related to grommet-icons #57

Closed miloxeon closed 5 years ago

miloxeon commented 5 years ago

I just created new Grommet app with grommet-cli. Now I'm doing npm start and I'm getting this:

ERROR in ./node_modules/grommet/es6/components/hocs.js
Module not found: Error: Can't resolve 'grommet-icons/es6/contexts/ThemeContext' in '/Users/*****/shtrafovnet/node_modules/grommet/es6/components'
 @ ./node_modules/grommet/es6/components/hocs.js 15:0-91 240:31-47
 @ ./node_modules/grommet/es6/components/AccordionPanel/AccordionPanel.js
 @ ./node_modules/grommet/es6/components/AccordionPanel/index.js
 @ ./node_modules/grommet/es6/components/index.js
 @ ./node_modules/grommet/es6/index.js
 @ ./src/App.js
 @ ./src/index.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 ./src/index.js

ERROR in ./node_modules/grommet/es6/components/Box/Box.js
Module not found: Error: Can't resolve 'grommet-icons/es6/contexts/ThemeContext' in '/Users/*****/node_modules/grommet/es6/components/Box'
 @ ./node_modules/grommet/es6/components/Box/Box.js 13:0-91 147:38-54
 @ ./node_modules/grommet/es6/components/Box/index.js
 @ ./node_modules/grommet/es6/components/index.js
 @ ./node_modules/grommet/es6/index.js
 @ ./src/App.js
 @ ./src/index.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 ./src/index.js

Countless of errors like these. I just can't get started, again! Page renders tho, but it has no icons, just blank rectangles that change their color on hover.

alansouzati commented 5 years ago

We should definitely update the grommet-cli. sorry it is not in sync with the latest grommet bits.

I will update it later today.

FYI we are officially deprecating grommet-cli in favor of create react app. We will be soon offering tutorials on how to get started with v2 using that flow.

miloxeon commented 5 years ago

@alansouzati wow, really? That's amazing! I just can't get started with create-react-app with Grommet added. I tried adding it manually just that way, but it appears to be unstyled somehow.

Text is in Work Sans though, but everything else is unstyled.

Can you please help me with that? I'm starting a new shiny project and I want it to have the both latest create-react-app and Grommet.

Or if you can't because of some reason, can I use grommet-react-app in production yet?

alansouzati commented 5 years ago

It seems that you are using Grommet v1 in a v2 platform. make sure your package.json is using 2.0.0-rc, the latest official version is still v1.

grommet-react-app is an ejected create-react-app for Grommet v1. I would not recommend starting with v1 at this point.

v2.0.0-rc is a release candidate, and we are planning to officially release grommet v2 soon.

miloxeon commented 5 years ago

Okay, I’m not going to use cli anymore. How do I get styles to work in create-react-app v2 and Grommet v2?

alansouzati commented 5 years ago

it comes built in, you dont have to worry about it.

miloxeon commented 5 years ago

Yep! It seems like I messed it up somehow yesterday. Now I did all this from scratch and it works perfectly.

Thanks a lot! The issue is solved.