babel-polyfill

Object doesn't support property or method 'replace' on Internet Explorer 11

折月煮酒 提交于 2021-02-10 16:41:28
问题 I am trying to make my Vuejs application work on IE11. However, one node module ( vue-directive-tooltip ) throw an error on IE11: Object doesn't support property or methode "replace" The module is supposed to be IE11 compatible. I have tried to require the polyfill I need at the top of the entry point to my application. I have also tried to add the node module to the transpile dependencies. vue.config.js: require("@babel/polyfill"); configureWebpack: { entry: ["@babel/polyfill", path.resolve(

`regeneratorRuntime` is not defined when running Jest test

非 Y 不嫁゛ 提交于 2020-04-07 17:38:10
问题 The title pretty much explains what I'm facing. I'm trying to test a React component that has some state, and I attempt to provide my store to the component in order to get what it needs. When I run the test of the component using Jest, I get the following error: ReferenceError: regeneratorRuntime is not defined I've determined through some reading that this is caused by babel-polyfill or regenerator-runtime not being applied correctly to Jest. However, I've tried installing both of those

How to add flatMap using babel 7?

≯℡__Kan透↙ 提交于 2019-12-23 07:47:14
问题 After reading the article Removing Babel's Stage Presets by babel , I still not fully understand how to add a proposal from, for example, stage-3 (flatMap) to .babelrc . As far as I understand, because flatMap can be written in ES5, then I need a polyfill and not a plugin. I installed @babel/polyfill under --save-dev but the browser still tells me that this method doesn't exist. I guess that @babel/polyfill doesn't cover experimental features. 回答1: flatMap was removed from @babel/polyfill for

babel polyfill being included, but forEach still doesn't work in IE11 on NodeLists

前提是你 提交于 2019-12-20 20:38:36
问题 I've got Webpack working with Babel and including the @babel/polyfill, yet IE11 is still throwing a SCRIPT438 error when trying to use .forEach on a NodeList . Here's my package.json { ... "scripts": { "build:js": "webpack --config ./_build/webpack.config.js" }, ... "browserslist": [ "IE 11", "last 3 versions", "not IE < 11" ], "babel": { "presets": [ [ "@babel/preset-env", { "useBuiltIns": "usage" } ] ] }, "devDependencies": { "@babel/core": "^7.1.6", "@babel/preset-env": "^7.1.6", "babel

How do I use babel's `useBuiltIns: 'usage'` option on the vendors bundle?

北城余情 提交于 2019-12-20 10:49:10
问题 Since I need to support also IE11, I need to transpile also node_modules . This is the babel config I use on the node_modules: presets: [ ['@babel/preset-env', { modules: false, useBuiltIns: 'usage' }], ], I use the useBuiltIns options because it was giving an error Symbol is not defined , the polyfill was needed. However this configuration breaks at compile time, supposedly because it injects some imports in the code, here is the error: Basically it's not liking the module.exports . So how

Promise is undefined in IE11 using babel-polyfill

我们两清 提交于 2019-12-18 12:55:18
问题 As the title says, even I'd like to use babel-polyfill to allow me to use promises in my code, but I get that undefined error in IE11. I've been trying to make this work for a while as I've seen that has been asked in different sites a few times, but none of the solutions really worked for me (or more accurately I was probably not able to adapt them to my code) These are the files that, I think, are involved: .babelrc { "presets": [ "es2015", "react" ] } package.json: I have babel-polyfill

what is this code case 6:case “end”:return _context15.stop() babel react-redux webpack in devtools

[亡魂溺海] 提交于 2019-12-13 03:56:22
问题 In my react-redux application, i have used many libraries especially babel 6.4.1 which i could not upgrade it, webpack 4, polyfill and hundreds of other libraries, anyway; At the lates state i am calling an api in front-end and api returning true result for a method but i have seen extra codes after the methods in chrome webpack dev-tools sources. Which effecting my codes and application does not run stable for this reason. I have researched all google but couldn't understand why? My function