FusionAuth/fusionauth-node-client

setinterval(...).unref is not a function

Closed this issue · 5 comments

JWTManager.js?8e3b:63 Uncaught TypeError: setInterval(...).unref is not a function
at eval (JWTManager.js?8e3b:63)
at Object../node_modules/@fusionauth/node-client/lib/JWTManager.js (build.js:1280)
at webpack_require (build.js:712)
at fn (build.js:95)
at eval (index.js?c2d1:10)
at Object../node_modules/@fusionauth/node-client/index.js (build.js:1244)
at webpack_require (build.js:712)
at fn (build.js:95)
at eval (LoginPage.vue?188a:47)
at Object../node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./node_modules/eslint-loader/index.js!./example/src/pages/pages/LoginPage.vue?vue&type=script&lang=js (build.js:1410)

npm@6.13.7
node@v13.10.1
VueJs

It's possible this is a configuration issue. I saw this error in my Jest tests, because Jest uses a "jsdom" context by default. All I had to do was tell Jest to use a "node" context with:

https://www.npmjs.com/package/jest-environment-node

and

https://jestjs.io/docs/en/configuration#testenvironment-string

testEnvironment: "node"

I know (see) your stack trace is webpack / babel, so this probably not a test issue, but hopefully it pushes you in the right direction...

Oh, this is in VueJS (more reading the stack).

Yeah, I wouldn't expect this client is browser compatible due to this. Could be nice option if it was though.

If you would like to compile the code to work in the browser then I recommend using our typescript client. We also have a client explicitly designed for the browser. This client is designed with only nodejs in mind.

If you would like to be the most future compatible then I recommend targeting typescript as we plan to make it the source of the nodejs and browser code.

I am also going to list this as a won't fix because this client isn't meant to be compiled for the browser. If you absolutely need this client to work in the browser you will need to create/include a unref polyfil (even if its a no-op for the browser).

I recommend targeting typescript as we plan to make it the source of the nodejs and browser code.

I'm so excited to hear this. 🎉