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

yarn start fails on on latest commit (1db816b) #13

Open
joshmhanson opened this issue May 15, 2021 · 1 comment · Fixed by #16
Open

yarn start fails on on latest commit (1db816b) #13

joshmhanson opened this issue May 15, 2021 · 1 comment · Fixed by #16
Labels
bug Something isn't working

Comments

@joshmhanson
Copy link
Contributor

Here's the error I'm getting:

yarn run v1.22.5
$ react-scripts start

There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.

The react-scripts package provided by Create React App requires a dependency:

  "babel-loader": "8.1.0"

Don't try to install it manually: your package manager does it automatically.
However, a different version of babel-loader was detected higher up in the tree:

  /home/hanjiexi/Projects/sparc/mcitmocks/src/main/client/node_modules/babel-loader (version: 8.2.2) 

Manually installing incompatible versions is known to cause hard-to-debug issues.

If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That will permanently disable this message but you might encounter other issues.

To fix the dependency tree, try following the steps below in the exact order:

  1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
  2. Delete node_modules in your project folder.
  3. Remove "babel-loader" from dependencies and/or devDependencies in the package.json file in your project folder.
  4. Run npm install or yarn, depending on the package manager you use.

In most cases, this should be enough to fix the problem.
If this has not helped, there are a few other things you can try:

  5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.
     This may help because npm has known issues with package hoisting which may get resolved in future versions.

  6. Check if /home/hanjiexi/Projects/sparc/mcitmocks/src/main/client/node_modules/babel-loader is outside your project directory.
     For example, you might have accidentally installed something in your home folder.

  7. Try running npm ls babel-loader in your project folder.
     This will tell you which other package (apart from the expected react-scripts) installed babel-loader.

If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That would permanently disable this preflight check in case you want to proceed anyway.

P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I did everything the above recommended to no avail except for the "SKIP_PREFLIGHT_CHECK" suggestion. Here's what I got from npm ls:

$ npm ls babel-loader
mcitmocks-client@0.0.1 /home/hanjiexi/Projects/sparc/mcitmocks/src/main/client
├─┬ @storybook/addon-essentials@6.2.8
│ └─┬ @storybook/addon-docs@6.2.8
│   └─┬ @storybook/builder-webpack4@6.2.8
│     └── babel-loader@8.2.2  deduped
├─┬ @storybook/react@6.2.8
│ ├─┬ @storybook/core@6.2.8
│ │ └─┬ @storybook/core-server@6.2.8
│ │   └── babel-loader@8.2.2  deduped
│ └─┬ @storybook/core-common@6.2.8
│   └── babel-loader@8.2.2 
└─┬ react-scripts@4.0.3
  └── babel-loader@8.1.0

The frontend still compiles for me on the previous commit, so I guess storybook is introducing the conflict.

I'm beginning to wonder if we should reconsider about using Docker to synchronize environments?

@joshmhanson joshmhanson added the bug Something isn't working label May 15, 2021
@wilsonplau wilsonplau linked a pull request May 15, 2021 that will close this issue
3 tasks
@wilsonplau
Copy link
Contributor

wilsonplau commented May 15, 2021

This is just a versioning issue - Docker probably wouldn't fix it either tbh. See #16.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants