Skip to content

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

Open

Description

@RPerGamo

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions