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

Hot reloading on file changes in docker no longer working in typescript 4.9.5 #52712

Closed
andersd1 opened this issue Feb 10, 2023 · 7 comments
Closed
Labels
External Relates to another program, environment, or user action which we cannot control.

Comments

@andersd1
Copy link

Bug Report

After upgrading to typescript 4.9.5, hot reloading stopped working in a docker environment. In our use case, we are using nestjs with command nest start xx --watch --tsc. I saw in the issue linked below that there have been changes to the file system. Is there anything docker/nest/typescript can do to get it working again ?

docker/compose#10027

🔎 Search Terms

docker

🕗 Version & Regression Information

After upgrading to typescript 4.9.5

🙁 Actual behavior

Docker no longer detecting file changes

🙂 Expected behavior

Docker should detect file changes

@jakebailey
Copy link
Member

After upgrading TypeScript to 4.9.5 from which version?

@andersd1
Copy link
Author

From 4.8.4

@submarines-and
Copy link

submarines-and commented Feb 14, 2023

Stopped working for us as well. Maybe this is what changed?

#50366

@RyanCavanaugh RyanCavanaugh added the External Relates to another program, environment, or user action which we cannot control. label Feb 14, 2023
@RyanCavanaugh
Copy link
Member

Yeah, we changed the default filesystem watch implementation to one that's generally more efficient. It's possible your OS/FS/etc environment doesn't support this, however. You can set the "watchFile" setting in your tsconfig to something else; the default is new "usefsevents", but "fixedpollinginterval" is likely to work anywhere.

@andersd1
Copy link
Author

fixedpollinginterval worked fine.
Thanks!

@matthandlersux
Copy link

posting a recap and adding a few extra keywords since it took me a bit to track down this issue from google... for anyone else that ends up here due to an error that looks like:

error TS6053: File '/path/to/real/file.ts' not found.

i believe the new way that file watching works does not work on macos catalina (10.15.x, and possibly below), so the suggestion above was required. to be more explicit: add to your tsconfig.json:

  "compilerOptions": {
    ...
  },
  "watchOptions": {
    "watchFile": "fixedpollinginterval",
  },

alternatively you can set the following environment variable:

export TSC_WATCHFILE="PriorityPollingInterval"

and here's the section about it in the docs

@nguyenthanhan201
Copy link

Yeah, we changed the default filesystem watch implementation to one that's generally more efficient. It's possible your OS/FS/etc environment doesn't support this, however. You can set the "watchFile" setting in your tsconfig to something else; the default is new "usefsevents", but "fixedpollinginterval" is likely to work anywhere.

Thank you. You saved my day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
External Relates to another program, environment, or user action which we cannot control.
Projects
None yet
Development

No branches or pull requests

6 participants