Skip to content

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

@RPerGamo

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!

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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy