AzureAD / microsoft-authentication-library-for-js

Microsoft Authentication Library (MSAL) for JS
http://aka.ms/aadv2
MIT License
3.64k stars 2.65k forks source link

While building in prod mode in ES6 targeted project is not working as @azure/msal-angular library is targeting es5 #3066

Closed sameerrswt closed 3 years ago

sameerrswt commented 3 years ago

Library

Framework

Description

My application is targeting ES6.

As I can see that @azure/msal-angular library is targeting ES5.

So when i am building my application in prod mode with build-optimizer=true and optimization=true. It works fine when I am set either of these properties to false.

it is not working and giving error. "Must call super constructor in derived class before accessing 'this' or returning from derived constructor."

Error Message

image

"Must call super constructor in derived class before accessing 'this' or returning from derived constructor."

I am able to replicate this issue on sample application provided in below repo by changing its target to ES6.

path for sample app: https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/samples/msal-angular-samples/angular6-sample-app/tsconfig.json

just change target to es6 and build in prod mode. application will stop working.

MSAL Configuration

No change. As provided in sample.

Reproduction steps

I am able to replicate this issue on sample application provided in below repo by changing its target to ES6 in tsconfig file.

path for sample app: https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/samples/msal-angular-samples/angular6-sample-app/tsconfig.json

just change target to es6 and build in prod mode. application will stop working.

tsconfig.json { "compileOnSave": false, "compilerOptions": { "baseUrl": "./", "outDir": "./dist/out-tsc", "sourceMap": true, "declaration": false, "module": "esnext", "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, "target": "es6", "typeRoots": [ "node_modules/@types" ], "paths": { "jszip": [ "node_modules/jszip/dist/jszip.min.js" ] }, "lib": [ "es2017", "dom" ] } }

Expected behavior

It should work with ES6 in prod mode with build-optimizer=true and optimization=true in angular.json.

Identity Provider

Browsers/Environment

Regression

Security

Source

pkanher617 commented 3 years ago

@sameerrswt Thanks for opening this issue. It looks like you've opened this before as well, sorry for not getting back to you on this.

msal-angular v1 is compiled for es5 to support IE11 browsers. Have you looked at msal-angular v2?

github-actions[bot] commented 3 years ago

This issue has not seen activity in 14 days. If your issue has not been resolved please leave a comment to keep this open. It will be closed in 7 days if it remains stale.

github-actions[bot] commented 3 years ago

This issue has been closed due to inactivity. If this has not been resolved please open a new issue. Thanks!