Questions tagged [babel-loader]
718 questions
91
votes
1 answer
What is the difference between babel-core and @babel/core?
What is the difference between
babel-core and @babel/core ?
Are they the same thing but different versions? If not so, when do you use one and when do you use the other?
Thank you.

YulePale
- 6,688
- 16
- 46
- 95
59
votes
1 answer
Why use babel-loader with ts-loader?
There is a TypeScript, Babel, React, and Karma Sample.
The Webpack config contains babel-loader with ts-loader for .tsx? files.
Please explain why it is needed? Why isn't ts-loader enough?

Yuriy
- 1,370
- 4
- 14
- 30
59
votes
1 answer
babel vs babel-core vs babel-loader vs babel-preset-2015 vs babel-preset-react vs babel-polyfill
I was setting up Webpack for my React project and got confused between babel, babel-core, babel-loader, babel-preset-2015 and babel-preset-react. I know that Babel is needed to transform ES7 or ES6 code to ES5 but in my package.json I have installed…

ankita.gulati
- 899
- 1
- 8
- 15
35
votes
15 answers
Problems with babel loader in react-create-app
The Problem
create-react-app initializes a repository where babel-loader is installed as an older version than needed.
LOG:
There might be a problem with the project dependency tree.
It is likely not a bug in Create React App,
but something you need…

Paul Losev
- 969
- 1
- 12
- 17
34
votes
9 answers
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader - Vue 3
I get the following error when i want to start my vue 3 typescript project:
ERROR Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs.…

Jannik Buscha
- 658
- 1
- 9
- 18
32
votes
1 answer
How to transpile node_modules modules with babel-loader?
Problem: I want to build bundle files for a website for older browsers (>= IE10).
My transpiled code throws errors on old Internet Explorer 11 when I transpile the code with babel 7.x using babel-loader as it seems node_modules modules won't get…

Michael
- 493
- 1
- 4
- 8
28
votes
1 answer
Plugins[0][1] must be an object, false, or undefined
I have been trying to upgrade my packages and things have started to fall apart and I am now unable to build and cannot seem to figure out what is the issue. I suspect the issue is related to the .babelrc file as it is a babel-loader error being…

ComputerLocus
- 3,448
- 10
- 47
- 96
26
votes
2 answers
Module build failed (from ./node_modules/babel-loader/lib/index.js): TypeError: Cannot read property 'bindings' of null
I've got an error while building a project:
Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: Cannot read property 'bindings' of null
My development environment is as follows:
Node: 8.0.0
npm:…

jini
- 373
- 1
- 5
- 15
25
votes
3 answers
How to upgrade to Babel 7
I tried to upgrade Webpack and Babel to 4, 7 respectively but couldn’t make it work. Also the official doc isn’t helping much with the upgrade.
I am getting following issue
compiler error: ERROR in Cannot find module '@babel/core' @…

Hemadri Dasari
- 32,666
- 37
- 119
- 162
23
votes
2 answers
React - Module parse failed: Unexpected Token. You may need an appropriate loader to handle this file type
My first time using react, so apologies if I'm doing something obvious and incredibly wrong. That said, I've read up on several similar-seeming bugs on here and on github and I can't find anything that works for mine. Here's the full error…

paul45
- 233
- 1
- 2
- 5
20
votes
1 answer
ts-loader vs babel-loader in Typescript using webpack
So I was trying to compare the output compiled code by these 2 combinations.
ts-loader
{
test: /\.tsx?$/,
use: 'ts-loader',
}
babel-loader
use: {
loader: 'babel-loader',
options: {
presets:
[
…

fjplaurr
- 1,818
- 3
- 19
- 36
20
votes
5 answers
Can't resolve 'core-js/modules/es.array.concat'
I upgraded babel 6.x → 7.x but having issues running Webpack.
It is complaining about missing core-js/modules/*.
My babel.config.js is in the root directory. I converted the previously existing .babelrc to js (.babelrc also produced the same…

Elijah
- 1,252
- 3
- 21
- 32
20
votes
3 answers
Webpack babel-loader runtime: Module build failed: TypeError: this.setDynamic is not a function
I'm trying to use the babel-loader with the babel-plugin-transform-runtime.
I've followed the instructions at:
https://github.com/babel/babel-loader#babel-is-injecting-helpers-into-each-file-and-bloating-my-code
The relevant code:
rules: [
// the…

yccteam
- 2,168
- 4
- 25
- 47
19
votes
8 answers
Parsing error: Cannot find module '@babel/preset-react'
I have a React project. In the first line in every .js file where I import React, I am getting this error: Parsing error: Cannot find module '@babel/preset-react'.
package.json
{
"name": "admin",
"version": "2.0.0",
"description": "",
…

Matt
- 8,195
- 31
- 115
- 225
19
votes
14 answers
Create React App requires a dependency: "babel-loader": "8.1.0"
There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locall
y.
The react-scripts package provided by Create React App requires a dependency:
"babel-loader":…

RANJAN KUMAR JHA
- 227
- 1
- 2
- 7