Questions tagged [babel-loader]
718 questions
7
votes
3 answers
Parser "babylon" deprecated error - webpack build
After I have been upgrading my projects JS packages, an error has appeared when building my bundle with Webpack. It seems to appear when building a .vue-file and can appear on any .vue-file build. I don't have "babylon" in my package.json and I have…

Kris D. J.
- 612
- 2
- 7
- 16
7
votes
1 answer
Is this webpack warning safe to ignore?
I found a strange warning in webpack. While parsing process.env using babel-loader. A warning(TypeError: result.setExpression is not a function) occurred inwebpack/lib/Parser.js. I'm on a big project and want my core to be super solid. So is it safe…

addlistener
- 871
- 1
- 12
- 20
7
votes
1 answer
webpack 4 : bundle js not found
I recently upgraded to webpack 4. The page is getting loaded successfully and whenever changes happened it refreshes the page automatically using webpack-dev-server. It does very nice but in the console it shows below error
GET…

Hemadri Dasari
- 32,666
- 37
- 119
- 162
7
votes
4 answers
Create React Native App. - Plugin/Preset files are not allowed to export objects, only functions
Need some help, I'm getting a weird error out of left field that I have not been able to debug. This project was bundling successfully until yesterday after I setup my react native project on another Mac.
I'm wondering if it's from versioning of npm…

hancho
- 1,345
- 3
- 19
- 39
7
votes
2 answers
How to get dynamic imports to work in webpack 4
I'm trying to migrate my app to webpack 4. My head hurts already.
Dynamic imports - this is my method of code splitting (page by page). But I can't get it to work. Have set up very simple tester with following packages:
"devDependencies": {
…

Coco
- 1,550
- 3
- 24
- 43
7
votes
1 answer
What is the location of .babelrc file when using create-react-app?
I used create-react-app to build a project and Babel comes packaged with the installation. Usually .babelrc file is located in the root of the project but I don't see one there. I need to modify one of the presets in the file but cannot seem to find…

Nicholas Porter
- 2,588
- 2
- 23
- 37
6
votes
4 answers
Migrating from ES5 to TS gradually
I am running on a huge project with thousands of .js files that are written in es5, and for many reasons and benefits of TS, we've decided to start migrating to TS, after a couple of days and many pieces of research, I am going to elaborate a couple…

Abdulrahman Falyoun
- 3,676
- 3
- 16
- 43
6
votes
3 answers
Module's not resolving in typescript monorepo with Next.js projects
I have a monorepo using yarn workspaces that has 2 Next.js projects.
apps
┣ app-1
┗ app-2
app-1 needs to import components from app-2. To do this, I add the app-2 project as a dependency and set the path in our app-1 tsconfig like so:
app-1…

mattmb
- 79
- 1
- 6
6
votes
1 answer
Why does my Create React App Dev Server take so long to start?
I have created a web application in React with Create React App. Somewhere in my development process, the launch time for my development server grew tremendously. It now takes about 8 minutes to launch. I am using Craco to modify my Webpack config…

JeremyEastham
- 177
- 2
- 11
6
votes
1 answer
How to use d3.js v7 with jest and babel-loader?
I have some react project that uses d3.js v6.7.0 and I am able to test it with jest 27.2.0 on windows 10.
Part of my settings in jest.config.js:
testEnvironment: "jsdom",
testRunner: "jest-jasmine2",
transform: {
'^.+\\.jsx?$':…

Stefan
- 10,010
- 7
- 61
- 117
6
votes
0 answers
Jest Test Support for the experimental syntax 'jsx' isn't currently enabled
I am writing first tests for my app and just install Jest.
My test is pretty simple, so I don't think the error I am getting is coming from there.
import React from 'react';
import renderer from 'react-test-renderer';
import FancyInput from…

vbotio
- 1,566
- 3
- 26
- 53
6
votes
2 answers
How to make yarn start work inside Docker image with react-scripts 3.4 and babel-loader 8.1?
I'm building a Docker image for debugging of my React application with a separate Dockerfile
FROM node:11-alpine
COPY package.json .
COPY yarn.lock .
RUN yarn install
COPY public/ ./public/
COPY src/ ./src/
EXPOSE 3000
CMD yarn run start
with…

Kalle Richter
- 8,008
- 26
- 77
- 177
6
votes
0 answers
@babel/runtime: SyntaxError: Unexpected token export @babel/runtime/helpers/esm/extends
two different checkouts of same code resulting in two different versions of @babel/runtime for the same version of babel
one version of @babel/runtime is "7.6.3" which contains commonJS module exports
but another version of it is "7.9.2" which…

Ashutosh Verma
- 309
- 1
- 2
- 11
6
votes
1 answer
Webpack and Babel not transpiling a dependency inside node_modules that breaks IE 11 and Edge due to ES6's spread syntax
I have a project that uses @mdx-js/runtime and it completely breaks on IE 11 or Edge (Edge 44.18362.449.0):
SCRIPT1028: SCRIPT1028: Expected identifier, string or number
It actually breaks because of the spread syntax here:
const allNodes =…

Danziger
- 19,628
- 4
- 53
- 83
6
votes
1 answer
Babel with NodeJS not working spread operator
I'm using Babel (7.5.0) and NodeJS latest (12.x), so the spread operator is already handled by NodeJS and I don't want babel to mess with it.
This is my .babelrc :
{
"plugins": [
"@babel/plugin-proposal-class-properties",
…

HRK44
- 2,382
- 2
- 13
- 30