-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Typescript stops transpiling in development bundle #27773
Comments
A curious thing just happened when this occurred again : invoking the developer menu and choosing "Stop Debugging" made the latest changes appear, but then turning debug mode on again lost them again, it runs a previous bundle. Does it give anyone a clue what might be happening? |
It seems this is something to do with the Chrome debugger. If I close that and run React Native Debugger instead, it starts to behave. Is there some caching of bundled javascript going on in chrome debugger? It shows the latest .ts code if I browse the source. |
I am having this issue as well. Turning on debugging in Chrome causes the device to use an outdated version of the bundle. Made me think I was going nuts when I couldn't make any of my chances show up! |
Though it uses the chrome debugger internally, I found that switching to https://github.com/jhen0409/react-native-debugger to do the debugging sorts the issue out. That is unless it starts happening there too. I think there's some bundle caching going on in chrome, but not sure how to disabled/clear it |
Thats what I ended up doing. I realised that I didn't specifically mention that in the above post so apologies if it took you more time to find the workaround. |
Yeah it's nothing to do with Typescript transpiling. It's only proved to be an issue occasionally (I don't know why) and until I stumbled upon that solution recently just switching between Chrome debugger and react-native-debugger whenever it happened allowed me to continue. |
I have a RN project set up with typescript. In general it works, but in some cases we make changes to the .ts/.tsx files which are NOT reflected in a debugged app (ios simulator). We've tried doing a clean build, clearing caches, forcing the tsc task, restarting the laptop and simulator, removing the app from the simulator, just about everything, but can't seem to get the debug build to recognise edits again. On previous occasions it has resolved itself eventually but I haven't managed to tie down what made the difference, and I've wasted precious development hours trying.
Changes to screens ARE sometimes reflected immediately via fast refresh but NOT changes to underlying services (in general called via redux action creators), but other times not. Production builds reflect the latest changes but even doing this doesn't affect the dev build if we do one afterwards. All very strange. It's as if only certain parts of the app are re-bundled for development on a change, perhaps there is some caching is involved?
If I examine the source in chrome dev tools, it shows the changed tsx files but that's not what's running on the simulated device. Is there anywhere I can see the transpiled javascript that is bundled?
React Native version:
Steps To Reproduce
tsconfig.json
package.json:
npm run ipad
Note: this project started off by using https://github.com/huestack/create-react-native-typescript-app, then we adopted https://github.com/ds300/react-native-typescript-transformer, then finally we migrated it to using the approach advocated by RN itself (https://facebook.github.io/react-native/docs/typescript) - so we may have made some mistakes during these migrations.
The text was updated successfully, but these errors were encountered: