Questions tagged [babel-preset-env]

73 questions
2
votes
1 answer

Missing class properties transform when Webpack presets:"env"

I'm testing React project on webpack-dev-server. I want to use classfield syntax but got an error at state init. client:162 ./src/containers/App.js Module build failed (from ./node_modules/babel-loader/lib/index.js): SyntaxError: Missing class…
SooJungChae
  • 219
  • 1
  • 4
  • 16
2
votes
1 answer

how to install babel-cli babel-preset-react

I tried all possible way to install babel-cli babel-preset-react Things I tried npm install --save-dev babel-cli babel-preset-react but when I check babel -h It shows The program 'babel' can be found in the following packages: I refer this question…
Mohsin
  • 199
  • 5
  • 19
2
votes
2 answers

babel-preset-env not changing build size

I have an ES6 React app that is being bundled with webpack and using babel. I am configuring babel-preset-env, for node everything is working perfect, but for browser the size of my build is not changing regardless the target percentage. The size is…
Dani
  • 141
  • 1
  • 5
1
vote
2 answers

Babel error: Invalid Version: 70001900000

Disclaimer: I haven't found anything useful in the CHANGELOG. I recently upgraded the following Babel dependencies: @babel/core ^7.15.0 -> 7.21.5 @babel/preset-env ^7.14.7 -> 7.21.5 @babel/preset-react ^7.14.5 -> 7.18.6 and…
1
vote
0 answers

Unexpected token export in NextJS 5 application

I am trying to use date-holidays npm package in my NextJS 5 application. This package has a dependency on another package called astronomia. I am using Babel 6. When I build the application it throws the following…
Irfan
  • 566
  • 7
  • 13
1
vote
1 answer

browserslist: Versions of a specific browser released since a date

Our policy is to support the Desktop versions of Firefox, Chrome and Edge that were stable in the last year. Example: Today is 2022-01-12, so we support the releases of Chrome since 2022-01-11 and the release that was stable back then: 78…
htho
  • 1,549
  • 1
  • 12
  • 33
1
vote
1 answer

How to create non-minified and minified builds with babel

I installed below babel modules npm install babel-cli babel-preset-env babel-preset-minify --save-dev and package.json has "scripts": { "build": "babel src -d dist --copy-files" } When I run the build with below .babelrc configurations { …
Vivek
  • 11,938
  • 19
  • 92
  • 127
1
vote
0 answers

babel.config.js vs .babelrc (Vue + Express in same directory)

You can directly skip to the last part of this section for the exact questions? For full context, read from the start. This is how I initiated my Vue project: vue create awesome-frontend choose all defaults and ended up with babel.config.js file in…
saibbyweb
  • 2,864
  • 2
  • 27
  • 48
1
vote
1 answer

@babel/preset-env not reading browserslist from package.config

I have created the environment variable (user and system) BROWSERSLIST_CONFIG and set it to C:\Program Files (x86)\Microsoft VS Code\bin\package.json. However, when I run webpack and set debug to true I get empty targets: @babel/preset-env: `DEBUG`…
rory
  • 1,490
  • 3
  • 22
  • 50
1
vote
0 answers

Babel presets ordering is occurring run-time error

I got an error SCRIPT1006: Expected ')' on IE(chrome was good) and reordered babel presets fixing the error. You know babel presets loaded by backward. I wondered how presets ordering affects the result and what is best practice presets…
astroplex
  • 53
  • 1
  • 5
1
vote
0 answers

Why es3 features are polyfilled by babel-polyfill?

I use @babel/preset-env + babel-polyfill + corejs3 with "useBuiltIns": "usage" in .babelrc config. I use browserlist to target the following browsers: ie >= 9 edge >= 12 firefox >= 36 chrome >= 49 safari >= 10 I found that some ES3 features are…
David Lin
  • 13,168
  • 5
  • 46
  • 46
1
vote
2 answers

node not recognizing express even though it is installed

Something that previously worked is no longer working and I'm stumped as to how to fix this. I am running on Mac and have the following versions: Node: v10.14.1 npm: 6.9.0 express: ^4.16.4 @angular/cli: ^7.3.3 babel-preset-env: ^1.7.0 I am getting…
hapakikui
  • 25
  • 6
1
vote
3 answers

Requires Babel "^7.0.0-0", but was loaded with "6.26.3" - @babel/preset-env

I get the following error the moment I install @babel/preset-env and try running a node.js file. Requires Babel "^7.0.0-0", but was loaded with "6.26.3" Following is the stack trace (While processing preset:…
Arun
  • 3,036
  • 3
  • 35
  • 57
1
vote
1 answer

Error: Cannot load preset env relative to / in a browser

I am creating interactive JavaScript coding exercise using ACE editor. to execute entered code have have to transform code. for that i am using @balel/core transform method. I am facing below problems when I use presets: ["env"] in options i am…
Harish
  • 1,841
  • 1
  • 13
  • 26
1
vote
2 answers

Which plugins (javascript features) does babel-preset-env support?

Babel-preset-env converts ES2015+ javascript features to compatible code for specified target environments. But I checked https://babeljs.io/docs/en/babel-preset-env and https://babeljs.io/docs/en/presets, and it doesn't say there which javascript…
croraf
  • 4,332
  • 2
  • 31
  • 50