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

preserveSymlinks option not honored #332

Closed
ryedin opened this issue Aug 28, 2019 · 8 comments
Closed

preserveSymlinks option not honored #332

ryedin opened this issue Aug 28, 2019 · 8 comments
Labels

Comments

@ryedin
Copy link

ryedin commented Aug 28, 2019

Current behavior

If you have folders of code that are symlinked into src (very common pattern for monorepo style development), the type checker does not re-trigger when those files are changed.

Expected behavior

I should be able to make changes to those symlinked files and have the typechecker correctly re-run checks.

Steps to reproduce the issue

Setup a basic CRA app with typescript enabled. Have another folder of typescript code sitting as sibling to your project. Create a symlink within the CRA src folder to your "shared" folder.
add "preserveSymlinks": true, to your tsconfig.json.

If you create a typescript error on purpose in the shared code and start the app you will observe the checker does correctly pick up the code and display the error. However, if you fix the error, the checker does not automatically re-check as it would if the file lived natively in the CRA app's src dir.

Environment

  • fork-ts-checker-webpack-plugin: 1.5.0 (from current version of CRA scripts)
  • typescript: 3.5.3
  • tslint: N/A
  • webpack: 4.39.1 (current version in CRA)
  • os: Mac 10.13.3 (AND Ubuntu 18.04)
@ryedin ryedin added the bug label Aug 28, 2019
@johnnyreilly
Copy link
Member

Thanks for the detailed report. I'm afraid I'm not able to look at this myself right now. This is definitely functionality we would want. If you'd like to take a look we're happy to look at PRs and collaborate!

@gyancse08
Copy link

I think this problem is coming from chokidar, paulmillr/chokidar#696.
They fixed it in the version 3.x. We only need to update the version here.

@gyancse08
Copy link

I think this problem is coming from chokidar, paulmillr/chokidar#696.
They fixed it in the version 3.x. We only need to update the version here.

I was trying to create a branch for this fix but I am not able to publish my branch due to access to this repo. Could you please provide me the access?

@johnnyreilly
Copy link
Member

Hi @gyancse08,

Thanks for looking into this! Please could you fork the fork-ts-checker-webpack-plugin repo, work on that and send a pull that way?

@gyancse08
Copy link

When I publish my branch I am getting this error:
"You do not have permission to access this repository".

only change is following, I will appreciate if someone else fixes the same.

  • "chokidar": "^2.0.4",
  • "chokidar": "^3.2.1",
  • "@types/chokidar": "^1.7.5",
  • "@types/chokidar": "^2.1.3",

@phryneas
Copy link
Contributor

phryneas commented Oct 15, 2019

You need to fork this project, push the changes to a branch on your fork and then send a pull request, that's the "github workflow". :)
Here's some more information: https://help.github.com/en/articles/creating-a-pull-request-from-a-fork

@piotr-oles piotr-oles mentioned this issue Apr 18, 2020
26 tasks
@piotr-oles
Copy link
Collaborator

piotr-oles commented May 23, 2020

@ryedin
Please try fork-ts-checker-webpack-plugin@alpha - I've published a new version which should resolve this issue 🚀
I will close this issue to clean-up the backlog. If this release didn't solve the issue, we can re-open this :)

@J-Rojas
Copy link

J-Rojas commented Jan 4, 2021

@piotr-oles Hi, the v5.0.0@beta fixed the problem for me within my npm@7 workspace project. However, the v6 master branch detects a change, but it continues to compile with the previous file contents of the symlinked file, not the new contents. Have these commits been merged into the latest master?

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

6 participants