
Showing util.inherits is not a function while importing jwt in vue vite
since util is a node built in it won't get polyfill by vite, add this plugin to your project
npm install --save-dev vite-plugin-node-polyfills
and then you add this to your vite.config.js
import { defineConfig } from 'vite'
import { nodePolyfills } from 'vite-plugin-node-polyfills'
export default defineConfig({
plugins: [
nodePolyfills(),
],
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With