Questions tagged [babel-loader]

546 questions
72
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
  • 3,549
  • 6
  • 25
  • 59
53
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…
36
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,021
  • 4
  • 12
  • 28
25
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
  • 383
  • 1
  • 3
  • 7
24
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
  • 345
  • 1
  • 3
  • 13
22
votes
12 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
  • 704
  • 1
  • 8
  • 15
19
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' @ multi …
Hemadri Dasari
  • 23,970
  • 25
  • 87
  • 133
15
votes
3 answers

babel 7.x - 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,162
  • 3
  • 19
  • 31
14
votes
1 answer

Transpiling Array.prototype.flat away with @babel?

I inadvertently introduced a backwards compatibility issue in my React app by using Array.prototype.flat. I was very surprised this didn't get resolved by transpiling - I thought this would result in es2015 compatible code. How can I get Babel 7 to…
DerKastellan
  • 143
  • 2
  • 7
14
votes
1 answer

Whats the difference when configuring webpack babel-loader vs configuring it within package.json?

Hi please help me understand the differences between setting babel config inside .babelrc vs webpack loader options, vs inserting it in package.json. For example, Would it make any difference if I put the presets in the webpack babel-loader options…
Davis Davis
  • 429
  • 4
  • 12
14
votes
4 answers

Unexpected token: operator (>) from UglifyJs

I have 2 Vue-Cli webpack projects (ClientApp and Lib). Lib is my components library (shared with other projects) Problem When I build my project ClientApp npm run build, I have the following error: ERROR in static/js/app.d08a24ce0e8d0438ce68.js from…
Zysce
  • 1,100
  • 1
  • 10
  • 32
11
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
  • 2,779
  • 9
  • 41
  • 80
11
votes
2 answers

Webpack Babel-loader transpiles code with eval()

I'm having an issue with Webpack and Babel. I'm trying transpile my JavaScript code into a bundle file. Here's the file structure and the snippets: file structure: - src | file.js package.json webpack.config.js package.json: { "name":…
Ivan
  • 11,733
  • 5
  • 35
  • 63
10
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
  • 1,819
  • 3
  • 19
  • 42
9
votes
1 answer

How to fix ' Support for the experimental syntax 'exportDefaultFrom' isn't currently enabled' in node

I have a full stack javascript application running on React, Node, express. The problem is export without default is not working in node, However, It is working fine in react. Both my node and react share the same babel configs and packages. I've…
Waeez
  • 329
  • 1
  • 6
  • 23
1
2 3
36 37