-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
When attempting to instantiate a Client object in a Vite/Vue3 app, the error Uncaught TypeError: util.inherits is not a function is thrown.
Environment
- Node 18.16
Steps to Reproduce
- Create a new Vite/Vue3 app, install dependencies, and launch app
npm create vite@latest duo-vite-test -- --template vue
cd duo-vite-test
npm install
npm install @duosecurity/duo_universal
npm run dev- Instantiate
ClientinApp.vue <script setup>block
import { Client } from '@duosecurity/duo_universal'
const client = new Client({
clientId: 'theclientid',
clientSecret: 'theclientsecret',
apiHost: 'theapihost',
redirectUrl: 'http://localhost:5173',
})- When the app reloads, the following error is thrown:
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:139Metadata
Metadata
Assignees
Labels
No labels