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
Fix missing imports in react projects #43
Conversation
just looking at this... The react-scripts package provided by Create React App requires a dependency:
currently package includes
plus If I upgrade eslint to 7.11.0 at compile get this error. seems react-scripts is set to 4.0.0 when is might need to be 3.4.3? |
Looks like react 17, create react app 4, and react-scripts 4 have some undesirable behavior. |
create-react-app pulls the latest version of react and react-scripts, so we can't even lock down on the older version of CRA in our CLI to ride this out. The other option is to try to fix these linting errors in the generated files programatically. |
I updated the App.tsx file to pass our linting rules. We will need to publish a new version of the lint config to get the last couple errors: etn-ccis/blui-code-standards#29 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@emclaug2 do you have the cli linked up correctly to use the local version? If you do |
I explicitly made the minimum eslint version 7.11.0 even though ^7.0.0 should have picked that up anyway, just to be safe. The newly published eslint-config should also clear up any lint errors. A new project should spin up nicely without issue now. |
Did you pull the latest CLI code and start a fresh project? What settings did you use in the CLI? |
yeah, just pulled latest, yarn and ran pxb new. > react and yes to everything |
If I down grade these to 4.0.1 in my new react project it runs fine
|
@jeffvg you said mac is fine? Do you have the cli installed globally on your PC? Global installations can cause problems with local yarn link. |
I have no issues on my mac. Only PC. C:\pxblue |
@jeffvg I've published a beta package to NPM to see if that gets around the linking issues. You can try:
|
the beta worked out the same for me with same errors as before. |
This is so strange; I got the same error as @jeffvg 👍 This error should be caused by an older version of our eslint config rules. Even though the specified version of the @pxblue/eslint-config is |
That's really strange. You're not getting the Can you go into the generated project and run |
same as issue you linked to, no caret ^ |
anyone use "yarn check"? Its been a while for me but here is some output from it on a new React project. error "@material-ui/core##react@^16.8.0" doesn't satisfy found match of "react@17.0.1" |
The latest beta version of the cli spins a working project for me 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all good with latest. Verified pc/mac
The latest version of create-react-app no longer adds a line for importing the service worker. We were using this in our find/replace script to add our imports into the index. So projects started with the CLI are missing some required imports in order to run.
Changes proposed in this Pull Request: