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

Can't use VanillaJSTestApp2.0 Examples, missing files #6047

Closed
kaangoksal opened this issue May 19, 2023 · 1 comment · Fixed by #6048
Closed

Can't use VanillaJSTestApp2.0 Examples, missing files #6047

kaangoksal opened this issue May 19, 2023 · 1 comment · Fixed by #6048
Assignees
Labels
answered Question has received "first qualified response" bug-unconfirmed A reported bug that needs to be investigated and confirmed msal-browser Related to msal-browser package public-client Issues regarding PublicClientApplications question Customer is asking for a clarification, use case or information.

Comments

@kaangoksal
Copy link

kaangoksal commented May 19, 2023

Core Library

MSAL.js v2 (@azure/msal-browser)

Core Library Version

latest

Wrapper Library

Not Applicable

Wrapper Library Version

barebones files

Public or Confidential Client?

Public

Description

I'm trying to use this sample

samples/msal-browser-samples/VanillaJSTestApp2.0/app/default

there are missing files in nearly every index.html file in VanillaJSTestApp2.0 folder.

../../lib/msal-browser.js
../../lib/index.js

Following instructions are not valid

- You can run any VanillaJSTestApp2.0 sample by changing the `authConfig.js` file in the respective folder to match your app registration and running the `npm` command `npm start -- -s <sample-name> -p <port>` in the VanillaJSTestApp2.0 folder.
- You can run the TypescriptTestApp2.0 sample by changing the `AuthModule.ts` file to match your app registration and running the `npm` command `npm start` in the TypescriptTestApp2.0 folder.

Error Message

The resource from “http://localhost:30662/lib/index.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
[localhost:30662](http://localhost:30662/)
15:32:58.399 Loading failed for the <script> with source “http://localhost:30662/lib/index.js”. [localhost:30662:8:60](http://localhost:30662/)
15:32:58.439
Uncaught ReferenceError: msal is not defined
    <anonymous> http://localhost:30662/authConfig.js:13
[authConfig.js:13:13](http://localhost:30662/authConfig.js)
15:32:58.439
Uncaught ReferenceError: msal is not defined
    <anonymous> http://localhost:30662/auth.js:16
[auth.js:16:19](http://localhost:30662/auth.js)
15:33:07.603
Uncaught (in promise) ReferenceError: can't access lexical declaration 'myMSALObj' before initialization
    signIn http://localhost:30662/auth.js:49
    onclick http://localhost:30662/:1

I can also see that the server (npm start) replied with a 404 to /lib/index.js

Msal Logs

No response

MSAL Configuration

couldn't even get to that point yet

Relevant Code Snippets

all from this repo, no change

Reproduction Steps

1) pull repo 
2) cd samples/msal-browser-samples/VanillaJSTestApp2.0/
3) npm i
4) npm start 
5) Navigate the port shown on the console, localhost:30662

Expected Behavior

I expect files to be present and example working out of the box.

Identity Provider

Azure AD / MSA

Browsers Affected (Select all that apply)

Edge

Regression

No response

Source

Internal (Microsoft)

@kaangoksal kaangoksal added bug-unconfirmed A reported bug that needs to be investigated and confirmed question Customer is asking for a clarification, use case or information. labels May 19, 2023
@ghost ghost added the Needs: Attention 👋 Awaiting response from the MSAL.js team label May 19, 2023
@github-actions github-actions bot added msal-browser Related to msal-browser package public-client Issues regarding PublicClientApplications labels May 19, 2023
@ghost ghost assigned tnorling May 19, 2023
@tnorling
Copy link
Collaborator

These are local development samples for developing MSAL.js itself, you have to build the library first locally for the files to be available. That said these should all be msal-browser.js rather than index.js. I'll make a note to fix those paths.

If you would like a more straightforward tutorial I would suggest you start here or a more in-depth tutorial here

@ghost ghost added answered Question has received "first qualified response" Needs: Author Feedback Awaiting response from issue author and removed Needs: Attention 👋 Awaiting response from the MSAL.js team labels May 19, 2023
@tnorling tnorling linked a pull request May 19, 2023 that will close this issue
@ghost ghost removed the Needs: Author Feedback Awaiting response from issue author label May 22, 2023
@kaangoksal kaangoksal changed the title Can't use VanullaJSTestApp2.0 Examples, missing files Can't use VanillaJSTestApp2.0 Examples, missing files May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered Question has received "first qualified response" bug-unconfirmed A reported bug that needs to be investigated and confirmed msal-browser Related to msal-browser package public-client Issues regarding PublicClientApplications question Customer is asking for a clarification, use case or information.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants