square/js-jose

Getting error window is not defined in jose.min.js file

cmmahe1 opened this issue · 2 comments

Hello Team, I request you to help me on below error

I just used to install this by using below
npm i --save jose-jwe-jws

after importing getting started this error.

ReferenceError: window is not defined
at Module. (C:\code\sampleapp\node_modules\jose-jwe-jws\dist\jose.min.js:1:20348)
at Module. (C:\code\sampleapp\node_modules\jose-jwe-jws\dist\jose.min.js:1:21654)
at e (C:\code\sampleapp\node_modules\jose-jwe-jws\dist\jose.min.js:1:118)
at C:\code\sampleapp\node_modules\jose-jwe-jws\dist\jose.min.js:1:917
at Object. (C:\code\sampleapp\node_modules\jose-jwe-jws\dist\jose.min.js:1:926)

@emerose, @alokmenghrajani , @csstaub , @dgalling , @Mischala @rapropos
I am also facing similar issue, Not able to load https://github.com/square/js-jose/blob/master/dist/jose.min.js
using simple script tag, getting
Cross-Origin Read Blocking (CORB) blocked cross-origin response https://github.com/square/js-jose/blob/master/dist/jose.min.js with MIME type text/plain. See https://www.chromestatus.com/feature/5629709824032768 for more details.
and
Uncaught ReferenceError: Jose is not defined

Expecting your speedy assistance.

Hiya @shinde-prasad

The error above appears to be a CORS issue.
This means the browser is refusing to load the script.
I would recommend either downloading the script and including it in a build step, or loading it from a site more suited to distributing artifacts such as CDNjs.