-
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
Hot Module Replacement is buggy with TS #23776
Comments
Can you run If you believe this information is irrelevant to the reported issue, you may write |
Done |
Are you certain this is an issue with React Native? It looks like you're using Expo. |
I'm certain this is related to React-native, I'm not using an expo project for my real project. What I'm not certain is :
The thing is it works as long you don't patch the file and it get hot reloaded. Once you patch, this is yelling that you are doing some kind of redeclaration which is not allowed. If you're not re-exporting everything goes fine… |
I think this issue is the same as the one explained in #22592. It started happening after 0.56 (when |
@itsjgf Yep, looks really like this… |
Duplicate of #22592 |
I added the previous comment in order to link this issue to #22592. Let me know if we should close this. |
I don't know… You're the ticket manager ahah Looks like it's the same issue yeah, i'll try the wordaround given import C from './Currency;
const CurrencyHelper = C;
export {
CurrencyHelper
} In order to await EDIT: seems related to #22592 |
Create an index wrapper for components is apparently the issue. |
🐛 Bug Report
Hello,
I'm getting a HMR issue with ts barrels, along my styled-component styling…
To Reproduce
https://snack.expo.io/@screamz/hmr-issue
Download this expo project on local and run
npm i && npm i -g expo-cli && expo start
Activate HMR by shaking device, then go to
assetExample
and changecolor: green
tocolor: blue
.See that the app is crashing with HMR enabled saying « Attempting to change the getter of an unconfigurable object ». This is an issue with the barrel
index.ts
but i can't get it why ?Expected Behavior
This shoumd HMR correctly
Code Example
https://snack.expo.io/@screamz/hmr-issue
Environment
React native > 57 and / or expo @ latest
Typescript (didn't tested without specifically but what I do is ESM compliant)
The text was updated successfully, but these errors were encountered: