Questions tagged [babel-polyfill]

Babel Polyfill will emulate a full ES6 environment. This polyfill is automatically loaded when using babel-node.

Installation:

$ npm install babel-polyfill

To find more information :

265 questions
5
votes
3 answers

Vuetify/Lib Polyfilling for IE11 isn't working - SCRIPT1002: Syntax Error

I'm trying to reference vuetify/lib with the usual import Vuetify from "vuetify/lib", but when I do, the application chokes in IE11 with SCRIPT1003: Expected ':'. If I change the reference to import Vuetify from "vuetify" - without the /lib…
5
votes
0 answers

Exclude babel polyfills for standard libraries

While bundling our TS project into es5 using babel and webpack, we see polyfills for standard string methods like String.replace, String.match, String.split $ Added following core-js polyfill: es.array.join { "ie":"11" } $ Added following…
Tamil
  • 5,260
  • 9
  • 40
  • 61
5
votes
1 answer

Rollup + @babel/preset-env + @babel/polyfill

When using Rollup how can you get it to work with both @babel/preset-env and @babel/polyfill? The docs mentioned to add useBuiltIns: 'usage' but when I do this I get a require is not defined error in console. Below is what I have so far; is there a…
Maurice
  • 325
  • 2
  • 12
5
votes
0 answers

How To Use Babel Polyfill for Promises?

Hello I am new to using Babel to transpile and polyfill my code to work for older browsers like Edge and IE. I am currently having an issue with polyfilling my code for Promises. I check in Edge and the error I am receiving is: Error in created…
user9664977
  • 789
  • 2
  • 15
  • 28
5
votes
1 answer

Vue CLI 3 + Vuetify - Not working on IE 11 (Babel does not transpile?)

I’m using Vue CLI 3 with Vuetify for my project. It works well on Chrome and iOS 12, but it shows blank page on IE11 and iOS Safari < 12. The console in IE11 shows: SCRIPT1003: Expected ':' I think it’s because Babel does not transpile the ES6…
5
votes
7 answers

react warning cannot set state when using promises

I'm trying to query the server to get list of nav items so I can build my menu on init. I've so far managed to create a static page with 3 contents on the home page, which includes header, sidebar and content. The sidebar is the menu which is…
shorif2000
  • 2,582
  • 12
  • 65
  • 137
4
votes
3 answers

The decorators Plugin when .version is '2018-09' or not specified, requires a 'decoratorsBeforeExport' option, whose value must be a boolean

I am getting the following Babel error The decorators Plugin when .version is '2018-09' or not specified, requires a 'decoratorsBeforeExport' option, whose value must be a boolean.…
four-eyes
  • 10,740
  • 29
  • 111
  • 220
4
votes
1 answer

How do I polyfill Promise.any() using babel 7?

I use webpack to bundle my codes for my clients. According to my question here Is it possible to break away from await Promise.all when any promise has fulfilled (Chrome 80) I want to use Promise.any() but Promise.any is only available for Chrome85+…
Qiulang
  • 10,295
  • 11
  • 80
  • 129
4
votes
1 answer

BabelJS and Webpack config for maximum possible compatibility

My website must work with the most basic phone browsers imaginable, because my user base is rural Ethiopian children on very, very basic handsets. (I am using jquery to save handset battery, as most are 'recycled', second/third/fourth-hand and…
Chris
  • 5,664
  • 6
  • 44
  • 55
4
votes
1 answer

Angular 9 Uncaught ReferenceError: regeneratorRuntime is not defined

I created a new angular app, where I imported a 3rd party app (svgedit) by copying all the contents in dist folder into the angular app's assets folder and referenced it in the index.html. Now i get this error Uncaught ReferenceError:…
Subbu
  • 588
  • 1
  • 7
  • 18
4
votes
0 answers

SCRIPT1010: Expected identifier Error when compiling React project in IE11

I have a bug in my React app, where it does not work on IE11. I have tried polyfills and hoped they would handle all such errors on old browsers. The best solution would be to prompt all IE users to just download Chrome or Firefox, but theres no…
Wellington
  • 383
  • 1
  • 4
  • 13
4
votes
0 answers

react-static: Promise is undefined on IE11

In this react-static app I'm coding, I've noticed the aforementioned error is occurring on IE11 and below only. It's happening on some of my project's dependencies, and not on the code I wrote myself (and I'm pollyfilling the whole app with…
darksoulsong
  • 13,988
  • 14
  • 47
  • 90
4
votes
0 answers

Cannot find module 'core-js/...' even though @babel/polyfill is installed

We are using padStart. To support earlier version of Node we are using babel and its @babel/preset-env preset: [ "@babel/preset-env", { targets: { node: "6.11.5" }, // Support padStart et cetera useBuiltIns: "usage" …
Shaun Luttin
  • 133,272
  • 81
  • 405
  • 467
4
votes
0 answers

How to disable injection of all polyfills (except regeneratorRuntime) when using babel-preset-env?

I'm using Babel 6's babel-preset-env to compile code targeted at IE10+. { "presets": [ ["env", { "targets": { "browsers": ["ie >= 10"] } }], "stage-3", "react" ], "plugins": [ …
callum
  • 34,206
  • 35
  • 106
  • 163
4
votes
3 answers

Unknown plugin specified in .babelrc, attempted to resolve relative to path

So I've started a new react-native project and copied over the .babelrc file from my previous project. I've installed the necessary plugins but I'm getting the error Unknown plugin transform-decorators-legacy specified in .babelrc, attempted to…
MonkeyBonkey
  • 46,433
  • 78
  • 254
  • 460
1 2
3
17 18