-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
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
Using in Vite/Vue3 App Throws 'Uncaught TypeError: util.inherits is not a function' #15
Comments
Looks to be similar/related to auth0/node-jws#101 |
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. |
Stumbled upon this one recently too. Could be fixed with swapping oldish If maintainers are OK with the idea (@AaronAtDuo ?) I could prepare a PR to swap the JWT libs and probably update the build process to make this lib both CJS/ESM compatible. Though, I think there are still few node.js specifics in this lib too, which would need tackling (maybe later) to make this fully env-independent for both node and browsers. Alternatively, those can be handled with vite polyfill plugin. |
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: