You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using browser resolution, which is the way to go, Vitest fails when importing @auth/sveltekit:
SyntaxError: Named export 'jsx' not found. The requested module 'preact/jsx-runtime' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'preact/jsx-runtime';
const { jsx: _jsx, jsxs: _jsxs } = pkg;
❯ node_modules/@auth/sveltekit/dist/env.js:1:31
1| import { setEnvDefaults as coreSetEnvDefaults, skipCSRFCheck } from "@auth/core";
| ^
2| import { dev, building } from "$app/environment";
3| import { base } from "$app/paths";
import{SvelteKitAuth}from"@auth/sveltekit";// <-- This fails!import{it}from"vitest";it("test auth in some way",()=>{// ... });
With the reproduction URL, just run npm run i && npm run test to see the issue.
Expected behavior
Importing @auth/sveltekit should not cause any issues with Vitest.
The text was updated successfully, but these errors were encountered:
Stadly
added
bug
Something isn't working
triage
Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
labels
Nov 25, 2024
Environment
Reproduction URL
https://github.com/Stadly/reproduction/tree/auth.js/sveltekit-vitest-failing
Describe the issue
When using browser resolution, which is the way to go, Vitest fails when importing
@auth/sveltekit
:How to reproduce
@auth/sveltekit
With the reproduction URL, just run
npm run i && npm run test
to see the issue.Expected behavior
Importing
@auth/sveltekit
should not cause any issues with Vitest.The text was updated successfully, but these errors were encountered: