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.

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:closed
  • Created 9 months ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rschristiancommented, Dec 7, 2022

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.

0reactions
Bakhtiyar-Garashovcommented, Dec 7, 2022

Nope, the same library, same version and same kind of usage. Indeed it is odd.

Read more comments on GitHub >

github_iconTop 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 >

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