S
SolidJS2y ago
Mant

vitest error 'registerGraph'

Hello, have you encountered the following error?
TypeError: Cannot read properties of undefined (reading 'registerGraph')
- /node_modules/solid-js/store/dist/dev.js:213:9
TypeError: Cannot read properties of undefined (reading 'registerGraph')
- /node_modules/solid-js/store/dist/dev.js:213:9
vitest.config.ts
/// <reference types="vitest" />
/// <reference types="vite/client" />

import { defineConfig } from 'vitest/config'
import solidPlugin from 'vite-plugin-solid';
export default defineConfig({
plugins: [
solidPlugin(),
],
build: {
target: 'esnext',
},
test: {
environment: 'jsdom',
globals: true,
transformMode: { web: [/\.[jt]sx?$/] },
},
resolve: {
conditions: ['development', 'browser'],
alias: {
'@': __dirname + '/src',
"@lib": __dirname + '/../backend/src/lib',
},
}
})
/// <reference types="vitest" />
/// <reference types="vite/client" />

import { defineConfig } from 'vitest/config'
import solidPlugin from 'vite-plugin-solid';
export default defineConfig({
plugins: [
solidPlugin(),
],
build: {
target: 'esnext',
},
test: {
environment: 'jsdom',
globals: true,
transformMode: { web: [/\.[jt]sx?$/] },
},
resolve: {
conditions: ['development', 'browser'],
alias: {
'@': __dirname + '/src',
"@lib": __dirname + '/../backend/src/lib',
},
}
})
3 Replies
Alex Lohr
Alex Lohr2y ago
try to add { test: { ..., deps: { registerNodeLoader: false } } }. This is an issue with node@20 and vitest's module resolver.
Mant
MantOP2y ago
Thank you, that fixed the problem
Alex Lohr
Alex Lohr2y ago
Happy to help.
Want results from more Discord servers?
Add your server