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

Cannot find module 'babel-loader' after eject #4433

Closed
OshotOkill opened this issue May 10, 2018 · 10 comments
Closed

Cannot find module 'babel-loader' after eject #4433

OshotOkill opened this issue May 10, 2018 · 10 comments

Comments

@OshotOkill
Copy link

OshotOkill commented May 10, 2018

Is this a bug report?

Yes

Environment

OS: Mac os X 10.13.4
Node: v10.1.0/v9.11.1
yarn: v1.6.0
create-react-app: v1.5.2
react-scripts: v1.1.4

Description:

After running create-react-app my-app, yarn start works just fine. However after running yarn run eject and type yarn start again, the issue pumps out below:

yarn run v1.6.0
$ node scripts/start.js
internal/modules/cjs/loader.js:550
    throw err;
    ^

Error: Cannot find module 'babel-loader'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
    at Function.resolve (internal/modules/cjs/helpers.js:18:19)
    at Object.<anonymous> (/Users/norn/Desktop/my-app-9/config/webpack.config.dev.js:145:29)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
    at Module.require (internal/modules/cjs/loader.js:598:17)
    at require (internal/modules/cjs/helpers.js:11:18)
    at Object.<anonymous> (/Users/norn/Desktop/my-app-9/scripts/start.js:31:16)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

2018-05-10 5 04 05

Also, react-app-rewired directly fails when use command yarn start, due to the same issue described above.


@OshotOkill
Copy link
Author

Hey guys I find out this could be a bug which relates to yarnpkg itself.

It seems that yarn does not install babel-loader which couldn't be found in node_modules directory, however if the version of yarn is prior to 1.0.0 babel-loader would be installed properly.

@OshotOkill OshotOkill changed the title Cannot find module 'babel-loader' Cannot find module 'babel-loader' after eject May 11, 2018
@daresam
Copy link

daresam commented May 11, 2018

A simple fix to that just install 'babel-loader' again by typing yarn add babel-loader on your terminal

@OshotOkill
Copy link
Author

@daresam Yeah I manually install babel-loader as well, being my temporary solution. I've opened an issue on yarn and see if they can figure it out and handle it.

@gaearon
Copy link
Contributor

gaearon commented May 11, 2018

Closing because the issue is with a package manager.

@gaearon gaearon closed this as completed May 11, 2018
@mrezabidhendi
Copy link

mrezabidhendi commented Jul 10, 2018

I've just faced the exact same issue but I'm using npm as my package manager.
update: I installed yarn and I'm still having the issue there. Although It can be solved by installing 'babel-loader' manually

@velopert
Copy link

velopert commented Aug 7, 2018

I am having the same issue.

@fenilli
Copy link

fenilli commented Sep 21, 2018

for people having this problem, just run yarn/npm install after ejecting and it should be fine, some dependencies after ejection seens to be missing.

@Veera-B
Copy link

Veera-B commented Sep 22, 2018

I have faced same issue when I run the command> npm run eject, but I've solved this issue by run this command> yarn add babel-loader@7.

@rades12340
Copy link

I installed babel-loader, but I keep getting the same issue? What else could be a problem?

@AkMedIm
Copy link

AkMedIm commented Dec 3, 2018

@rades12340 try npm/yarn install !

@lock lock bot locked and limited conversation to collaborators Jan 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants