js icon indicating copy to clipboard operation
js copied to clipboard

bug: Import issue when in test environment using vitest

Open potikhanovsergey opened this issue 5 months ago • 1 comments

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

  • [ ] Logto Cloud
  • [+ ] Self-hosted, Logto version = 3.6.0
    • [ ] Container (Docker image)
    • [+ ] Raw Node.js

potikhanovsergey avatar Aug 31 '24 06:08 potikhanovsergey