logto-io / js

🤓 Logto JS SDKs.
https://docs.logto.io/quick-starts/
MIT License
65 stars 39 forks source link

bug: Import issue when in test environment using vitest #789

Open potikhanovsergey opened 2 months ago

potikhanovsergey commented 2 months ago

Describe the bug

Error: Cannot find module '/node_modules/next/navigation' imported from /node_modules/@logto/next/lib/server-actions/index.js
Did you mean to import next/navigation.js?

Similar closed issue from the other library: https://github.com/refinedev/refine/issues/5846

Expected behavior

How to reproduce?

1) import { getLogtoContext } from "@logto/next/server-actions"; in the server component 2) render the component using vitest

Context

wangsijie commented 1 month ago

Hi, @potikhanovsergey could you please provide a minimal repo that reproduce this issue? So that I can verify it.