web-infra-dev / rspress

🦀💨 A fast Rspack-based static site generator.
https://rspress.dev
MIT License
1.4k stars 129 forks source link

[Bug]: error TS2307: Cannot find module '@rspress/shared' or its corresponding type declarations #1495

Closed yonas closed 1 day ago

yonas commented 2 days ago

Version

System: OS: Linux 6.8 Ubuntu 24.04.1 LTS 24.04.1 LTS (Noble Numbat) Container: Yes

Details

Generated an empty chunk: "index".
success Build types [bundle]
success Build cjs,esnext files [bundle]
info    src/hooks.ts:9:31 - error TS2307: Cannot find module '@rspress/shared' or its corresponding type declarations. [tsc]
9 import type { PageData } from '@rspress/shared'; [tsc]
                                ~~~~~~~~~~~~~~~~~ [tsc]
info    src/utils.ts:13:8 - error TS2307: Cannot find module '@rspress/shared' or its corresponding type declarations. [tsc]
13 } from '@rspress/shared'; [tsc]
          ~~~~~~~~~~~~~~~~~ [tsc]
Found 2 errors. Watching for file changes. [tsc]

Reproduce link

https://github.com/web-infra-dev/rspress

Reproduce Steps

$ git clone https://github.com/web-infra-dev/rspress
$ cd rspress
$ bun install
$ bun run dev
Timeless0911 commented 2 days ago

I think this is the intermediate log when you start all projects with topological relationships at the same time.

I don't know how bun handles topological relationships and how it senses the finish of upstream project's dev process.

If workspaces B is a dependency of workspace A, if A runs dev command with B at the same time, such log will appear.