Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.1.3 broke AoT compiling (Function calls are not supported in decorators but 'MsalModule' was called) #798

Closed
snebjorn opened this issue Jun 28, 2019 · 18 comments
Assignees
Labels
bug A problem that needs to be fixed for the feature to function as intended. msal-angular Related to @azure/msal-angular package
Milestone

Comments

@snebjorn
Copy link

snebjorn commented Jun 28, 2019

I'm submitting a...


[x] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report 
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:

Library version

Library version: 0.1.3

Current behavior

When compiling using the AoT compiler (ng serve --aot or ng build --prod) it'll throw this error:

ERROR in Error during template compile of 'AppModule'
  Function calls are not supported in decorators but 'MsalModule' was called.

Expected behavior

No error

Minimal reproduction of the problem with instructions

Upgrade to "@azure/msal-angular": "0.1.3" and run ng serve --aot

@sbanerjee302
Copy link

Facing the same issue

@aleksandar-kandzhichki
Copy link

Same here

@snebjorn
Copy link
Author

I wonder what is going with this release. It's not even an updated changelog for it :/

@jasonnutter
Copy link
Contributor

Thanks for the information, we'll take a look. 0.1.3 was published to fix compatibility with IE11 (changelog entry will be added shortly), looks like it might broken this. Apologies about that.

@jasonnutter jasonnutter added the msal-angular Related to @azure/msal-angular package label Jun 28, 2019
@jasonnutter jasonnutter self-assigned this Jun 28, 2019
@jasonnutter
Copy link
Contributor

Unfortunately, the fix to properly support modern browsers and IE11 (for both JIT and AOT) is proving to be more complicated than expected. We have deprecated 0.1.3 and set the latest tag back to 0.1.2, so we recommend pinning your version of @azure/msal-angular to 0.1.2 while we work on a proper fix. Apologies for the inconvenience. I'll update this ticket when we have a proper resolution, thanks!

@jasonnutter jasonnutter added bug A problem that needs to be fixed for the feature to function as intended. investigating labels Jun 28, 2019
@mahi9984
Copy link

mahi9984 commented Jul 1, 2019

Thanks Json. for the info. We will be waiting for your drop.

@mirkodelgado
Copy link

Please keep me posted. My company has been waiting on a solution for the IE11 browser for some time now.
TIA,
Mirko

@Ivan-L
Copy link

Ivan-L commented Jul 12, 2019

Hey @jasonnutter,

We're also waiting in anticipation for the fix as msal-angular is currently breaking IE support in our application. So a +8 from us in this regard.

@mirkodelgado
Copy link

Hello @jasonnutter,
Any update on a fix for IE11? My company of holding off deploying a site because SSO not supported on IE11? Any time frame you can provide?

thanks,

Mirko

@DarylThayil DarylThayil added this to the 1.2.0 milestone Jul 25, 2019
@jasonnutter
Copy link
Contributor

We have published a new version of msal-angular with compatibility for IE11:

npm install @azure/[email protected]

Please test this version and let us know if there are any issues. We will promote to a stable release once we're confident this version doesn't introduce any regressions. Thanks!

@mirkodelgado
Copy link

@jasonnutter,

My app now comes up on IE11 version 11.885.17134.0, but I am receiving "null" when calling the getUser() method of the service. I am running "ng build --prod". The sample app works in a "ng serve" environment (code logic very similar). Safari and Chrome still work with new lib. The developer tools close on the redirect, so its hard to capture log entries, but when I do a refresh, I get the following (don't know if this can help):

client logging :: Tue, 06 Aug 2019 18:40:25 GMT:1234-0.2.2-Info State status:false; Request type:undefined
client logging :: Tue, 06 Aug 2019 18:40:25 GMT:1234-0.2.2-Error State Mismatch.Expected State: null,Actual State: fa67ef88-6741-4e3a-a703-2c1c5c624fcc

thanks,

Mirko

@jasonnutter
Copy link
Contributor

jasonnutter commented Aug 6, 2019

@mirkodelgado Ah whoops, forgot to mention that you should set the following config option:

const isIE = window.navigator.userAgent.indexOf("MSIE ") > -1 || window.navigator.userAgent.indexOf("Trident/") > -1;

MsalModule.forRoot({
  // ...
  storeAuthStateInCookie: isIE
})

Example: https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/angular-es5-ie11/lib/msal-angular/samples/MSALAngularDemoApp/src/app/app.module.ts#L45

Let me know if that fixes it.

@mirkodelgado
Copy link

@jasonnutter,

Got a little farther

  1. in the sample the function should be exported?
  2. Got "Function calls are not supported in decorators but isIE was called"
  3. Hard coded "true" for testing....got the following:

client logging :: Tue, 06 Aug 2019 19:16:09 GMT:1234-0.2.2-Info renewidToken is called
client logging :: Tue, 06 Aug 2019 19:16:09 GMT:1234-0.2.2-Info Add msal frame to document:msalIdTokenFrame
client logging :: Tue, 06 Aug 2019 19:16:09 GMT:1234-0.2.2-Info Navigate to:https://login.microsoftonline.com/e36e2432-b327-457a-bb91-2c778cfcb631/oauth2/v2.0/authorize?response_type=id_token&scope=openid%20profile&client_id=f7e272e2-45c7-4457-86a4-6e9abf1da69f&redirect_uri=https%3A%2F%2Fnewhire.maserconsulting.com&state=927bf6e1-22e9-4cc2-8c44-ff260a43f781&nonce=0725af4e-76be-4388-b441-cdfc1112cf36&client_info=1&x-client-SKU=MSAL.JS&x-client-Ver=0.2.2&client-request-id=d9ff6576-dd09-4c99-861a-ef63329aa501&prompt=none&login_hint=MGDelgado%40maserconsulting.com&domain_req=e36e2432-b327-457a-bb91-2c778cfcb631&login_req=ab4e8b68-8d9f-41fe-a53d-8e6d881b62c1&domain_hint=organizations
client logging :: Tue, 06 Aug 2019 19:16:09 GMT:1234-0.2.2-Info LoadFrame: msalIdTokenFrame
client logging :: Tue, 06 Aug 2019 19:16:10 GMT:1234-0.2.2-Info Add msal frame to document:msalIdTokenFrame
client logging :: Tue, 06 Aug 2019 19:16:10 GMT:1234-0.2.2-Info Frame Name : msalIdTokenFrame Navigated to: https://login.microsoftonline.com/e36e2432-b327-457a-bb91-2c778cfcb631/oauth2/v2.0/authorize?response_type=id_token&scope=openid%20profile&client_id=f7e272e2-45c7-4457-86a4-6e9abf1da69f&redirect_uri=https%3A%2F%2Fnewhire.maserconsulting.com&state=927bf6e1-22e9-4cc2-8c44-ff260a43f781&nonce=0725af4e-76be-4388-b441-cdfc1112cf36&client_info=1&x-client-SKU=MSAL.JS&x-client-Ver=0.2.2&client-request-id=d9ff6576-dd09-4c99-861a-ef63329aa501&prompt=none&login_hint=MGDelgado%40maserconsulting.com&domain_req=e36e2432-b327-457a-bb91-2c778cfcb631&login_req=ab4e8b68-8d9f-41fe-a53d-8e6d881b62c1&domain_hint=organizations
client logging :: Tue, 06 Aug 2019 19:16:11 GMT:1234-0.2.2-Info State status:true; Request type:RENEW_TOKEN
client logging :: Tue, 06 Aug 2019 19:16:11 GMT:1234-0.2.2-Info Error :login_required; Error description:AADSTS50058: A silent sign-in request was sent but no user is signed in.
Trace ID: 9e15b14b-3d26-4e77-a06a-f05a5d699500
Correlation ID: d9ff6576-dd09-4c99-861a-ef63329aa501
Timestamp: 2019-08-06 19:16:10Z
client logging :: Tue, 06 Aug 2019 19:16:11 GMT:1234-0.2.2-Error Error when acquiring token for scopes: f7e272e2-45c7-4457-86a4-6e9abf1da69f AADSTS50058: A silent sign-in request was sent but no user is signed in.
Trace ID: 9e15b14b-3d26-4e77-a06a-f05a5d699500
Correlation ID: d9ff6576-dd09-4c99-861a-ef63329aa501
Timestamp: 2019-08-06 19:16:10Z|login_required
ERROR TypeError: You provided 'undefined' where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
"ERROR"
{
[functions]: ,
proto: { },
message: "You provided 'undefined' where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.",
name: "TypeError",
stack: "TypeError: You provided 'undefined' where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
at h (https://newhire.maserconsulting.com/main.a79302272810b309d3a0.js:1:366203)
at l (https://newhire.maserconsulting.com/main.a79302272810b309d3a0.js:1:1470756)
at n.prototype.error (https://newhire.maserconsulting.com/main.a79302272810b309d3a0.js:1:57615)
at n.prototype._error (https://newhire.maserconsulting.com/main.a79302272810b309d3a0.js:1:326209)
at n.prototype.error (https://newhire.maserconsulting.com/main.a79302272810b309d3a0.js:1:325915)
at Anonymous function (https://newhire.maserconsulting.com/main.a79302272810b309d3a0.js:1:478225)
at e.prototype.invoke (https://newhire.maserconsulting.com/polyfills.8bbb231b43165d65d357.js:1:7007)
at onInvoke (https://newhire.maserconsulting.com/main.a79302272810b309d3a0.js:1:219363)
at e.prototype.invoke (https://newhire.maserconsulting.com/polyfills.8bbb231b43165d65d357.js:1:7007)
at t.prototype.run (https:/",
Symbol(INITIAL_VALUE)_h.3i29z5j8jcx: undefined,
Symbol(rxSubscriber)_g.3i29z5j8jcx: undefined
}

thanks,

Mirko

@jasonnutter
Copy link
Contributor

@mirkodelgado Looks like we may need to add the isIE check into the library itself, instead of forcing users to set it dynamically. I'll chat with the team.

For the login_required error, I believe this is a result of how IE handles cookies between zones. Unfortunately, this is a known issue in IE11, see the note in the README for the workaround.

@snebjorn
Copy link
Author

snebjorn commented Aug 7, 2019

I can confirm that ^0.1.4-beta.1 can compile using the AoT compiler 👍

@bjswick33
Copy link

I can confirm that ^0.1.4-beta.1 can compile using the AoT compiler 👍

I can also confirm. was at 0.1.3 and moved to .4-beta.1. Build completed. No code changes required.

@jasonnutter
Copy link
Contributor

We've published 0.1.4-beta.2 with a fix for issues with the route guard. If you were seeing issues related to that, please let us know if this new version fixes what you were seeing.

We'll release 0.1.4 soon (planning for later this week). Thanks!

@jasonnutter
Copy link
Contributor

This has been fixed with the betas, and will be included in the next release. Closing.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug A problem that needs to be fixed for the feature to function as intended. msal-angular Related to @azure/msal-angular package
Projects
None yet
Development

No branches or pull requests

9 participants