-
Notifications
You must be signed in to change notification settings - Fork 58
Closed
Description
I am using vitest to test files using renderToString
The vitest.config.ts file uses:
export default defineConfig({
plugins: [solidPlugin({ ssr: true })],
test: {
environment: "node"
},
});
Since vite-plugin-solid@2.11.1, I get the following error:
Error: renderToString is not supported in the browser, returning undefined
at throwInBrowser (.../node_modules/solid-js/web/dist/dev.js:1089:15)
As well as isServer (from solid-js/web) returning false.
I believe this is linked to this change: #173
The workarounds I have:
- Sticking to
vite-plugin-solid@2.11.0 Or using this workaround in(this leads to other issues)vitest.config.ts:ssr: { target: "webworker" }
Is it indeed a bug, or is there a better way to configure vitest to test ssr code from SolidJS?
Thanks!
Metadata
Metadata
Assignees
Labels
No labels