amplify-js: 🐞 Bug on IE 11 - Syntax error on version 3.*.* (not present before in 2.*.*)

🐞 Describe the bug I’m using the @aws-amplify/auth and @aws-amplify/core packages to add the AWS login functionality to a website.

Everything is fine in the previous releases:

  • @aws-amplify/auth: ^2.1.8
  • @aws-amplify/core: ^2.3.0

But, updating to the new one:

  • @aws-amplify/auth: ^3.2.3
  • @aws-amplify/core: ^3.2.3

Cause (only in IE 11) a Syntax error in the console.

P.S.: I’ve tried to update the libraries one-by-one, but the issue still persist.


To Reproduce

Steps to reproduce the behavior:

  1. Install the latest version of @aws-amplify/auth@^3.2.3 or @aws-amplify/core@^3.2.3;
  2. Import it in a project (i’m using it with webpack, in a Vue/Nuxt environment);
  3. Open the IE 11 Browser;
  4. Check the console.

Device

  • Device: PC
  • OS: Windows 10 x64
  • Browser: Chrome 83.0.4103.7 and IE 11

Sample code


import Auth from '@aws-amplify/auth';
import Amplify from '@aws-amplify/core';

Amplify.configure(
    {
         Auth: config,
     }
);

Auth.currentSession();

2020-04-14

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (6 by maintainers)

Most upvoted comments

@Amplifiyer Any idea on this?

This issue is resolved in the latest release, 3.0.22

aws/aws-sdk-js-v3#1319 The issue should be fixed in latest aws sdk v1.0.0-gamma.3 release (https://github.com/aws/aws-sdk-js-v3/releases/tag/v1.0.0-gamma.3)

Correct, we are testing this internally from the other changes within the release to validate it does not break any other additional Amplify use cases. We have an ETA of next week to get this change out. Thanks for the feedback!

aws/aws-sdk-js-v3#1319 The issue should be fixed in latest aws sdk v1.0.0-gamma.3 release (https://github.com/aws/aws-sdk-js-v3/releases/tag/v1.0.0-gamma.3)

@LuXDAmore I have found a workaround to transpile dependencies till we can get a fix from @ericclemmons , hopefully soon.

So the workaround is:

vue.config.js

module.exports = {
  transpileDependencies: ["@aws-sdk", "fast-xml-parser"]
}

babel.config.js Now, the babel config - I’m not saying you have to have it all like this - this is just mine. All I had to change was useBuiltIns from usage to entry, so it might be that it’s all that is needed. But you might also need to be aware of what presets I am actually using, which is different to what comes with Vue-CLI out of the box.

  plugins: [
    "@babel/proposal-object-rest-spread",
    "@babel/plugin-syntax-dynamic-import"
  ],
  presets: [
    [
      "@babel/preset-env",
      {
        targets: {
          ie: "11",
          browsers: "last 2 versions"
        },
        useBuiltIns: "entry",
        corejs: { version: 3, proposals: true }
      }
    ]
  ]
};

main.js

import "core-js/stable";
import "regenerator-runtime/runtime";