web icon indicating copy to clipboard operation
web copied to clipboard

Circular references in workspaces in web dev server 0.4 are not correctly resolved

Open RPerGamo opened this issue 5 months ago • 0 comments

Hello there! We've found a bug in @web/dev-server, versions 0.4 (it was not present in versions 0.3 and lower).

In a workspace with multiple packages, serving a file that contains circular references in imports (A imports B, B imports C, C imports A) there is an error when resolving imports.

Web Dev Server started...

  Root dir: /Users/XXX/workspace/web-dev-server-bug/packages/comp-c
  Local:    http://localhost:8000/
  Network:  http://192.168.5.185:8000/

Error while handling server request.
[Error: ENOENT: no such file or directory, stat '/Users/XXX/workspace/index.js'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'stat',
  path: '/Users/XXX/workspace/index.js',
  expose: true,
  statusCode: 404,
  status: 404
}

Small reproduction project here:

https://github.com/RPerGamo/web-dev-server-bug

To reproduce, clone the repo, install dependencies with NPM and run "start" script in "packages/comp-c".

If you lower the dev server version (in root package) to ^0.3.0, the error does not happen.

Thank you!

RPerGamo avatar Jul 23 '25 19:07 RPerGamo