compiling✖ ERROR Error: Babel-loader config not found!!!
See original GitHub issue- Check if updating to the latest Preact version resolves the issue
Describe the bug While trying to run npm run build I am getting the error below
Build [ ] 0% (0.0s) compiling✖ ERROR Error: Babel-loader config not found!!!
To Reproduce Install “preact-i18nline”: “^2.0.0” and follow the doc to add configs within preact.config.js as below
export default (config, env, helpers) => {
// Use Preact CLI's helpers object to get the babel-loader
let babel = helpers.getLoadersByName(config, 'babel-loader')[0].rule;
// Update the loader config to include preact-i18nline
babel.loader = [
{ // create an entry for the old loader
loader: babel.loader,
options: babel.options
},
{ // add the preact-i18nline webpack loader
loader: 'preact-i18nline/webpack-loader'
}
];
// remove the old loader options
delete babel.options;
};
then run command npm run build
Versions
“i18nline”: “^2.0.1”, “preact”: “^10.3.2”, “preact-i18nline”: “^2.0.0”, “preact-cli”: “^3.0.0”,
Issue Analytics
- State:
- Created 9 months ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
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 >Cannot find module '@babel/core' - node.js - Stack Overflow
Try running this. npm install @babel/core --save. babel changed their package so your babel-core will not be the same as @babel/core .
Read more >Error: Cannot resolve module 'babel-loader' · Issue #1083
I'm using webpack in directory /users/path/a/(it holds the webpack.config.js) and compile files in directlry /another/path/b/.
Read more >babel-loader - webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >How to Bundle JavaScript With Rollup — Step-by-Step Tutorial
Learn how to use Rollup as a smaller, more efficient alternative to webpack and Browserify to bundle JavaScript files in this step-by-step tutorial...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry, but that on its own won’t reproduce the issue. Was getting fine builds yesterday when I gave you that config. It likely has to do with your use of
preact-i18nline
?Please make it something that I can just clone & run.
Edit: Additionally, I’ve heard good things about https://github.com/synacor/preact-i18n, but haven’t used it myself. Maybe worth an peek.
Nope, the same library, same version and same kind of usage. Indeed it is odd.