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

Entry module not found: Error: Can't resolve 'babel-loader' #237

Closed
Aerendir opened this issue Jan 5, 2018 · 4 comments
Closed

Entry module not found: Error: Can't resolve 'babel-loader' #237

Aerendir opened this issue Jan 5, 2018 · 4 comments

Comments

@Aerendir
Copy link

Aerendir commented Jan 5, 2018

All worked well until I had the unhealthy idea of run yarn outdated and it shown me the outdated dependencies.

So I updated them and now when I run yarn encore dev I get this error:

Entry module not found: Error: Can't resolve 'babel-loader'

How can I solve this?

Trying to reset dependencies to their old version doesn't work.

I think it is related to something about Webpack (reading online something about the error), but I'm not so experienced with it to solve the error on my own.

My current configuration is this:

Encore
    // directory where all compiled assets will be stored
    .setOutputPath('web/build/')

    // what's the public path to this directory (relative to your project's document root dir)
    .setPublicPath('/build')

    // empty the outputPath dir before each build
    .cleanupOutputBeforeBuild()

    // will output as web/build/app.js
    .addEntry('main', './src/AppBundle/Resources/assets/js/_main.js')

    // will output as web/build/global.css
    .addStyleEntry('global', './src/AppBundle/Resources/assets/css/_global.scss')

    // allow sass/scss files to be processed
    .enableSassLoader()

    // allow legacy applications to use $/jQuery as a global variable
    .autoProvidejQuery()

    .enableSourceMaps(!Encore.isProduction())

    // create hashed filenames (e.g. app.abc123.css)
    .enableVersioning()

    // Enable react
    .enableReactPreset()

    .configureBabel((config) => {
        config.presets.push('stage-3')
    })
;
@Aerendir
Copy link
Author

Aerendir commented Jan 5, 2018

UPDATE

I read the yarn.lock file and I saw that there is a dependency on babel-loader: "^7.1.0" required by @symfony/webpack-encore@^0.17.1.

So I gone to my node_modules folder and looked for the package but it wasn't in the folder!

So I ran yarn add babel-loader and Yarn installed the package: It simply wasn't installed!

Now the command yarn encore dev works again, but the real question now is:

Why babel-loader wasn't installed also if required by the yarn.lock?

@weaverryan
Copy link
Member

Hey there! Hmm, it sounds like some weird yarn problem, honestly. At times, it seems that the node_modules directory can have the wrong files. Occasionally, I’ll completely remove the node_modules directory and run “yarn install” fresh. That’s my best guess: as you saw, we require that module, so it should be there :)

I think there’s nothing to be done here in this lib.

Cheers!

@Aerendir
Copy link
Author

Aerendir commented Jan 5, 2018

Yes, I think this, too... Thanks for closing the issue in my place :)

@mewhit
Copy link

mewhit commented Nov 21, 2018

I got the same problem. I just delete my node_modules , update my netlify-lambda package.
and everything run number one now.

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

3 participants