46560

Error in IE11 caused by babel polyfill - delegate.iterator.return

Question:

Hope to get some help with following:

<h2><strong>The problem</strong></h2>

@babel/polyfill causes error in IE11:

SCRIPT1010: Expected identifier

Debugger point on the line:

if (delegate.iterator.return) {

in the function maybeInvokeDelegate() in regenerator-runtime plugin.

<strong>But</strong>

Problem occures <strong>only in test environment</strong>. When I run my aplication locally, with exactly same build, same browser it works just fine. It contains same code, but it doesn't break anything.

<h2><strong>What I've already tried:</strong></h2> <ol><li>

<a href="https://babeljs.io/docs/en/next/babel-plugin-transform-member-expression-literals.html" rel="nofollow">babel-plugin-transform-member-expression-literals</a> doesn't seem to help.

</li> <li>

I tried to replace @babel/polyfill with only necessary polyfills but I failed. To much errors breaking application which are hard to catch/debug/understand.

</li> <li>

Set useBuiltIns: "usage" in .babelrc but faced a problem with way it imports necessary modules. I'm going to give this one more try.

</li> <li>

I looked through all same issues with regeerator-runtime and babel-polyfill on github, but haven't found working solution.

</li> </ol><h2><strong>Config</strong></h2>

At the moment I'm requiring @babel/polyfill in webpack config and use it as an entry point. I believe I don't even need regenerator-runtime, because as far as I understand it used for async function (maybe I'm mistaken) and we don't use them.

I'm not using babel loader for webpack but run babel for /dist directory after webpack.

<strong>My babelrc:</strong>

{ plugins: ["transform-member-expression-literals"], presets: [ [ "@babel/preset-env", { useBuiltIns: "entry", modules: "false", targets: { ie: 11 } }] ] }

<strong>webpack.config</strong>

require("@babel/polyfill") const getDefaultConfig = env => ({ mode: "development", entry: ["whatwg-fetch", "@babel/polyfill", "./src/index.js"], ... })

I have updated all babel packages to latest versions.

Appreciate any help or ideas.

Answer1:

Take a look at the link below

<a href="http://github.com/facebook/create-react-app/issues/4255" rel="nofollow">github.com/facebook/create-react-app/issues/4255</a>

Recommend

  • Facebook Login Button: Can I prevent auto page reload after login?
  • “error: no matching function for call to”
  • How to specify schema name while running “syncdb” in django?
  • “polymorphism” for FOREIGN KEY constraints
  • .length cannot be resolved or is not a field
  • Parsing proprietary tag syntax with regex - how to detect nested tags?
  • delay app release on the App Store
  • How to stop the python turtle from drawing
  • Show Spinner When Teble Row Click
  • How do I insert a line break in an xtable caption?
  • jre_home environment variable is not defined correctly while starting tomcat
  • exception thrown while building the java application using netbeans
  • Eclipse (ctrl+space) content assist hook
  • Problem with installing Charm-Crypto for Python3
  • NHibernate - Paging with ICriteria and optional ICriteria calls
  • Encode string to Base64 in Inno Setup (Unicode Version of Inno Setup)
  • MySql tables, error #1064 & error #1068 Multiple primary key defined [closed]
  • Project Euler -Prob. #20 (Lua)
  • Salesforce API: How to identify a Case from an email reference code (“[Ref: … :Ref]”)?
  • How to adapt DirectX-style world/view/projection matrices to OpenGL?
  • How to smoothly connect two signals in matlab [closed]
  • Nested AJAX Calls using .done
  • Spring annotation @Order
  • Do iTunesConnect external testers get updates for *every* uploaded ipa file after Beta Approval?
  • Error processing job: Project has not enabled BigQuery
  • Php artisan optimize is failing on production server
  • C++11: Why rvalue reference parameter implicitly converted to lvalue
  • Exclude Classes from Being Included in Shaded Jar
  • Windows biometric framework sample umdf driver: This device cannot start. (Code 10)
  • Ruby on Rails: Get mediaplayer information (iTunes, TRAKTOR, Cog; current song + playlist)
  • Creating 2d platforms using JavaScript
  • How to define something in JavaScript [closed]
  • Support of :after in IE7
  • Terminal run dalvikvm with am.jar
  • How to change user identity when git pushing via ssh?
  • Why isn't stemDocument stemming?
  • How to handle div that is created dynamically in a table
  • Make checkout phone field optional for specific countries in WooCommerce
  • ReferenceError: TextEncoder is not defined
  • Create/delete users from text file using Bash script