question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot use "resolveLoader" to resolve babel-loader presets and plugin

See original GitHub issue

I’m submitting a bug report

Webpack Version: 2.6.1

Babel Core Version: 6.25.0

Babel Loader Version: 7.0.0

Please tell us about your environment: OSX 10.x

Current behavior: the “node_modules” folder is out of the project directory, but I cannot resolve plugin at correct path by using the webpack config “resolveLoader”, got error " Unknown plugin “transform-react-jsx” specified in “base” at 0, attempted to resolve relative to…"

webpack config

resolveLoader : { path.resolve( __dirname, ‘…/node_modules’ ) }

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

14reactions
npisciotti1commented, Aug 10, 2017

@mingxian a similar problem has occurred to a few people. It seems the link that @dbethel provided is no longer working (at least not for me).

I’ve seen a solution similar to this when dealing with packages that are external to your project directory. This needs to be specified in your webpack.config.js, perhaps this will help:

 module: {
        loaders: [
            {
                test: /\.(js|jsx)$/,
                loader: 'babel-loader',
                query: {
                    presets: [
                        require.resolve('babel-preset-es2015')
                    ]
                }
            }
        ]
    },
0reactions
loganfsmythcommented, Sep 2, 2018

I’m triaging old issues on babel-loader. Since this has been inactive for ages, I’m going to close it. Feel free to re-open if there’s still something to discuss, but I’m assuming at this point it’s been too long to address in a useful way.

Babel 7 should also behave better around this stuff, so hopefully manually calling require.resolve will be less common

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - Can't resolve 'babel-loader' - Stack Overflow
Webpack has been initialised using a configuration object that does not match the API schema. - configuration.resolveLoader has an unknown ...
Read more >
Module not found: Can't resolve 'babel-loader' | bobbyhadz
To solve the error Module not found: Error: Can't resolve 'babel-loader', make sure to install the `babel-loader` package by opening your terminal in...
Read more >
webpack-chain: Neutrino configuration API
resolveLoader is identical to neutrino.config.resolve with the following ... You cannot use both .before() and .after() on the same resolve plugin.
Read more >
@gem-mine/webpack-chain - npm
Start using @gem-mine/webpack-chain in your project by running `npm i ... resolveLoader is identical to config.resolve with the following ...
Read more >
Can't resolve package error. : r/webpack - Reddit
const HtmlWebpackPlugin = require("html-webpack-plugin"); module.exports = (env = {}, argv = {}) => ({ module: { rules: [ { test: /\.js$/, use: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found