Questions tagged [babel-core]

37 questions
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…
21
votes
4 answers

babel@7 and jest configuration

Maybe you may help me? I try to configure jest to use babel@7 So I have: "jest": "^23.4.1", "@babel/core": "^7.0.0-beta.54", "babel-7-jest": "^21.3.3", "babel-jest": "^20.0.3", And jest config inside package.json "jest": { "transform": { …
SilentImp
  • 1,473
  • 1
  • 14
  • 27
6
votes
1 answer

Babel throws a type error when exporting aggregates

When running my gulp task, I get the following error: SyntaxError in plugin "gulp-babel" Message: /Users/******/Repos/******/src/scripts/config/index.js: Unexpected export specifier type > 1 | export * as constants from './constants'; …
Paulos3000
  • 2,717
  • 7
  • 30
  • 63
5
votes
0 answers

What are some ways to override local babelrc configurations?

I have a .babelrc file with certain configurations that I want to override in select situations (not environment-related). Unfortunately, babel documentation is not very clear on order of precedence for configs that are passed(i.e., .babelrc,…
Hammy1409
  • 61
  • 2
4
votes
0 answers

@babel/core Jest error: Must export a default export when using ES6 modules

Running Jest throws this error for a simple test file: Must export a default export when using ES6 modules. at createDescriptor (node_modules/@babel/core/lib/config/config-descriptors.js:170:13) at items.map…
Friendly-Robot
  • 1,036
  • 8
  • 21
4
votes
2 answers

Error: listen EADDRINUSE when using nodemon with babel 7

nodemon -v: 1.18.6 node -v: v11.2.0 Command: nodemon --exec babel-node lib/server.js My app starts ok with the above command. When I change the source code, I expect the nodemon restart automatically. But I got the error Error: listen EADDRINUSE:…
Long Tran
  • 843
  • 8
  • 10
3
votes
2 answers

Can not transform code with babel transform with config file

This is the config file: { "presets": [ "@babel/preset-env" ], "plugins": [ "@babel/plugin-transform-modules-commonjs" ] } This is the command: npx babel src/* --out-dir build The CLI output is src/script.js ->…
tscpp
  • 687
  • 7
  • 26
3
votes
1 answer

Babel plugin development for react-intl

I noticed that there are some performance gain opportunities for react-intl after comparing intl.formatMessage({ id: 'section.someid' }) vs intl.messages['section.someid']. See more here: https://github.com/yahoo/react-intl/issues/1044 The second is…
3
votes
1 answer

Use Babel Transform inside of React code

I'm trying to convert a string to valid JSX code, and then inject it into my React component. const babel = require('babel-core') let result = eval(babel.transform('

Hello

').code) But am getting hit with a wall of errors,…
Ben
  • 3,987
  • 6
  • 30
  • 47
3
votes
1 answer

Using babel-polyfill in production entry file

I'm using babel to transpile ES7 js code, and everything works like a charm in dev/staging. Inside the application, I heavily rely on async/await features of ES7. My entry file looks like this: 'use…
Ivan
  • 709
  • 4
  • 14
2
votes
0 answers

Module build failed: Error: Cannot find module 'babel-core' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)

Module build failed: Error: Cannot find module 'babel-core' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) sharing package.json file "dependencies": { "babel-loader": "^7.1.5", "cli-color": "^2.0.0", …
anu
  • 31
  • 2
2
votes
1 answer

react native bundling failed: Error: Requires Babel "^7.0.0-0", but was loaded with "6.26.3"

I get an error when using Expo in my react native app. When importing the following line of code. (Only part of my code where I use the import 'expo') import {Permissions, ImagePicker} from 'expo'; I get an error. I'm all day searching for a…
2
votes
1 answer

I am getting a 404 error on my new Reactjs app, is it looking for a main.js file?

This app should be rendering what I have here (/Users/ldco2016/Projects/reactquiz/src/components/App.jsx: import React, {Component} from 'react'; import ReactDOM from 'react-dom'; class App extends Component{ render(){ return( …
Daniel
  • 9,020
  • 8
  • 63
  • 101
1
vote
1 answer

Parcel build failed, showing babel error "Do not clone comments tha...... } could not be cloned"

I am getting following error when I was trying to create a build using parceljs. It is showing some babel file while creating build using parcel: yarn run v1.22.5 $ parcel build app.html -d static …
Gsmalhotra
  • 11
  • 1
1
vote
0 answers

Yarn --link-duplicates creates error while building

I run yarn install --link-duplicates in order to install packages. I get the following error NOENT: no such file or directory, lstat '/.../front/node_modules/@svgr/webpack/node_modules/@babel/core/node_modules The node_modules doesn't exist in the…
MAnast
  • 51
  • 6
1
2 3