Open StefanVrecic opened 2 years ago
Did you npm install
after cloning the repository ?
Did you
npm install
after cloning the repository ?
Used npm i @openid/appauth
from my project to install this as per usual
Tried npm install from the appauth's root folder with the package.json, same error with 'node_modules' not recognized
Using Windows.
I just encountered this issue, and resolved it by installing jquery
(npm or yarn), and:
import $ from 'jquery';
global.$ = $ // or: window.$ = $
The surprising thing here is that jquery
is neither installed as a sub-dependency, nor specified as a peer dependency, and it's not imported/required by this library -- $
is assumed to just exist as a global.
(also: maybe jquery
could be dispensed with, entirely, and replaced with a library that's more focused on data fetches. ...or perhaps just fetch)
You can just use it with the fetch API like so:
import {
AuthorizationServiceConfiguration,
FetchRequestor,
} from "@openid/appauth";
await AuthorizationServiceConfiguration.fetchFromIssuer(
openIdConnectUrl,
new FetchRequestor()
);
Thanks @sidharthramesh
Good grief, that should be the default!
Yes. I think this should be the default too
This is the first time I've encountered jQuery in probably 8 years! What a bizarre default.
You can also set this for BaseTokenRequestHandler
:
const tokenHandler = new BaseTokenRequestHandler(new FetchRequestor());
Newb here, do I just add " import * as $ from 'jquery' " into xhr.ts and then rebuild it using "npm run-script build-app" ?
That's what I tried but no luck, 'node_modules' not recognized as an internal or external command. Not sure how to configure the scripts or resolve this issue otherwise :/
(Have already taken a look at the other issues and your responses) Thank you :)