core-js: Cannot convert object to primitive value with core-js 3.1.3 + webpack

Env

  • webpack 4.32.2
  • babel-loader 8.0.6
  • core-js 3.1.3

Not sure what else should be added Will update this list if more entries are needed

Description

I already applied patch from https://github.com/rails/webpacker/pull/2031 to fix #514 But now I got this error Below are screenshots to the backtrace

1 2 3 4

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (2 by maintainers)

Most upvoted comments

It seems that jscomp_symbol_xxxx (the polyfill) is from Google Maps JS file https://maps.googleapis.com/maps/api/js?v=3&libraries=places

Loading it after the file containing core-js symbol polyfill would solve this issue

This also seems to be an issue with Google’s Recaptcha API. Removing it from the project or making it load after your packed bundle fixes IE11. The file in question that I had to move was //www.google.com/recaptcha/api.js?h1=en&render=explicit.

The specific IE11 error I was getting was:

SCRIPT5005: String expected in the regenerator-runtime library that seems to extend from this Symbol polyfill conflict.

image

Kind of annoying…

I reverted to core-js 2.5.7 and all the module.export errors stopped displaying.

Thanks @PikachuEXE - we had exactly the same issue with Google Maps, and managed to fix it with your solution 😀