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

Created on 14 Apr 2020  路  15Comments  路  Source: aws-amplify/amplify-js

馃悶 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

aws-sdk-js

All 15 comments

Awaiting a version bump for https://www.npmjs.com/package/@aws-sdk/eventstream-serde-browser

@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.

```module.exports = {
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";
```

Thank You @slavco86 , but unfortunately i can't touch my babel.config file 馃槅

Resolving this issue as the above aws sdk version is merged and released.

@sammartinez Thank You very much for your support! 馃殌

I've updated to the latest versions:

@aws-amplify/auth: ^3.2.13
@aws-amplify/core: ^3.3.3

But unfortunately the same issue still persist on IE 11 馃槶

Syntax error

IE 11, Syntax error

@LuXDAmore When you tried the latest version, did you remove your lock files and re installed?

@sammartinez Yes, i've also tried to deleted the entrire node_modules folder (just to be sure to have everything up-to-date).

@sammartinez

IDK if this can help, but in my package-lock.json i can see the gamma-version used everywhere:

{
    "@aws-sdk/middleware-serde": {
        "version": "1.0.0-gamma.1",
        "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-serde/-/middleware-serde-1.0.0-gamma.1.tgz",
        "integrity": "sha512-4rhB/x8zGmiN1k12fPG1LOxvK41XE8yOlayQyach2Lct30i38Oel/7wpnYaIXuTGFaY+npC127fgAY3XuMcdcw==",
        "requires": {
            "@aws-sdk/types": "1.0.0-gamma.1",
            "tslib": "^1.8.0"
        }
    }
}

Except for the @aws-sdk/client-cognito-identity and @aws-amplify/core that are still requiring an alpha-version of the @aws-crypto libraries:

{
    "@aws-amplify/core": {
         "requires": {
                "@aws-crypto/sha256-js": "1.0.0-alpha.0"
         }
    },
    "@aws-sdk/client-cognito-identity": {
        "version": "1.0.0-gamma.2",
        "resolved": "https://registry.npmjs.org/@aws-sdk/client-cognito-identity/-/client-cognito-identity-1.0.0-gamma.2.tgz",
        "integrity": "sha512-gGwTrKRN+mj48m4tXTilTbp1/aYO5mGIBPocDsG7digNFqxmjzFVNCq/yJfoBg7MCNBVlOFJ7i3bxM6H4cylow==",
        "requires": {
            "@aws-crypto/sha256-browser": "^1.0.0-alpha.0",
            "@aws-crypto/sha256-js": "^1.0.0-alpha.0"
        }
    }
}

@Amplifiyer Any idea on this?

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)

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!

@sammartinez Any news?

@sammartinez Any news?

Try Amplify 3.0.21

@petrovicigor @aws-amplify/auth: 3.0.21 and @aws-amplify/core: 3.0.21?

Because with this one fail

This issue is resolved in the latest release, 3.0.22

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TheRealRed7 picture TheRealRed7  路  3Comments

callmekatootie picture callmekatootie  路  3Comments

benevolentprof picture benevolentprof  路  3Comments

shinnapatthesix picture shinnapatthesix  路  3Comments

DougWoodCDS picture DougWoodCDS  路  3Comments