Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A linked dep's re-build while dev server is running causes TypeScript to not be able to find the dep anymore #771

Open
fabis94 opened this issue Aug 5, 2022 · 0 comments
Labels

Comments

@fabis94
Copy link

fabis94 commented Aug 5, 2022

Current behavior

So I have a monorepo using yarn 3.x workspaces and there's a package with webpack that depends on another package which is symlinked through yarn. The problem is that while a webpack dev server is running if I re-build that linked dependency, fork-t-schecker-webpack-plugin is no longer able to find that dependency, even after the linked rebuild has finished and there are definitely files there.

ERROR in src/main/lib/viewer/core/helpers/cameraHelper.ts:2:24
TS2307: Cannot find module '@speckle/viewer' or its corresponding type declarations.
    1 | import { Vector3 } from 'three'
  > 2 | import { Viewer } from '@speckle/viewer'
      |                        ^^^^^^^^^^^^^^^^^
    3 | import CameraControls from 'camera-controls'
    4 |
    5 | // wtf

The error above is being thrown even though @speckle/viewer (a linked package) has already been rebuilt and definitely exists at that point.

Expected behavior

After the linked package finishes rebuilding, fork-ts-checker-webpack-plugin should clear out its cache and re-evaluate whether the previously missing module and its types are still missing. They aren't, so it should pick up on that and stop reporting an error that no longer exists.

Issue reproduction repository

Here's a reproduction link: specklesystems/speckle-server#889

Steps to reproduce the issue

  • Checkout the branch
  • Run yarn dev:frontend from repo root to run the webpack dev server
  • Once its running, run yarn dev from 'packages/viewer'
  • The frontend dev server will rebuild, but wont be able to find the linked viewer dependency anymore

Environment

  • fork-ts-checker-webpack-plugin: tried ^5 and ^6
  • typescript: 4.5.4
  • eslint: [version from the package.json] 8.11.0
  • webpack: [version from the package.json] 4.46.0
  • os: [e.g. Ubuntu 19.04] Ubuntu 20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant