We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When attempting to instantiate a Client object in a Vite/Vue3 app, the error Uncaught TypeError: util.inherits is not a function is thrown.
Client
Uncaught TypeError: util.inherits is not a function
npm create vite@latest duo-vite-test -- --template vue cd duo-vite-test npm install npm install @duosecurity/duo_universal npm run dev
App.vue <script setup>
import { Client } from '@duosecurity/duo_universal' const client = new Client({ clientId: 'theclientid', clientSecret: 'theclientsecret', apiHost: 'theapihost', redirectUrl: 'http://localhost:5173', })
Uncaught TypeError: util.inherits is not a function at node_modules/jws/lib/data-stream.js (data-stream.js:39:6) at __require (chunk-OL3AADLO.js?v=606a3168:9:50) at node_modules/jws/lib/sign-stream.js (sign-stream.js:3:18) at __require (chunk-OL3AADLO.js?v=606a3168:9:50) at node_modules/jws/index.js (index.js:2:18) at __require (chunk-OL3AADLO.js?v=606a3168:9:50) at node_modules/jsonwebtoken/decode.js (decode.js:1:11) at __require (chunk-OL3AADLO.js?v=606a3168:9:50) at node_modules/jsonwebtoken/verify.js (verify.js:4:16) at __require (chunk-OL3AADLO.js?v=606a3168:9:50) triggerError @ vue-router.mjs:3451 (anonymous) @ vue-router.mjs:3173 Promise.catch (async) pushWithRedirect @ vue-router.mjs:3167 push @ vue-router.mjs:3099 install @ vue-router.mjs:3530 use @ runtime-core.esm-bundler.js:4381 start @ client-entry.js?t=1686682252177:120 await in start (async) (anonymous) @ client-entry.js?t=1686682252177:165 Promise.then (async) (anonymous) @ client-entry.js?t=1686682252177:163 Promise.then (async) (anonymous) @ client-entry.js?t=1686682252177:139
The text was updated successfully, but these errors were encountered:
Looks to be similar/related to auth0/node-jws#101 also https://stackoverflow.com/questions/70727494/why-cant-i-use-jwt-verify-from-jsonwebtoken-in-react
Sorry, something went wrong.
Thanks @AaronAtDuo ! I'll take a look at that. Appreciate the reference.
I'm looking through those myself. I'm not a Node and/or JS dev so bear with me :)
It doesn't look like there's a great solution for this, but maybe the best one is to introduce some sort of polyfill to work around this?
Thanks @AaronAtDuo -- that's what we've found so far as well, so we'll dig into that angle a bit more.
No branches or pull requests
When attempting to instantiate a
Client
object in a Vite/Vue3 app, the errorUncaught TypeError: util.inherits is not a function
is thrown.Environment
Steps to Reproduce
npm create vite@latest duo-vite-test -- --template vue cd duo-vite-test npm install npm install @duosecurity/duo_universal npm run dev
Client
inApp.vue <script setup>
blockThe text was updated successfully, but these errors were encountered: