Closed RaulCatalinas closed 5 months ago
Similar issue but referencing crypto. A workaround that seems to work is excluding it:
import { sveltekit } from '@sveltejs/kit/vite'
import { defineConfig } from 'vitest/config'
import { nodePolyfills } from 'vite-plugin-node-polyfills'
export default defineConfig({
plugins: [
sveltekit(),
nodePolyfills({
// WORKAROUND: https://github.com/davidmyersdev/vite-plugin-node-polyfills/issues/90
exclude: ['crypto']
})
],
test: {
include: ['src/**/*.{test,spec}.{js,ts}']
}
})
It worked, I just had to exclude crypto
to solve the error.
I'm importing the modules "fs" and "os" in this file
And when I pull up the development server it gives me this error
Here's my Astro configuration