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

[turborepo] HMR lost if you import shared ui package inside _app and index files #4689

Closed
pacxiu opened this issue Apr 25, 2023 · 2 comments
Closed
Labels
kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage

Comments

@pacxiu
Copy link

pacxiu commented Apr 25, 2023

What version of Turborepo are you using?

1.9.3

What package manager are you using / does the bug impact?

Yarn v1

What operating system are you using?

Mac

Describe the Bug

HMR is not working as expected and performs full refresh of app and it looses it's state if you modify file in package that is both imported in:

_app.tsx
index.tsx

I've started to encounter this bug in some of my shared Layouts that I had and thought maybe I have some cyclic dependencies but I could also reproduce it on sample repo.

Expected Behavior

It should not perform full refresh and keep it's state.

To Reproduce

  • Open Console
  • Go to Button.tsx in ui package, modify eg. Button Text
  • App will perform full-refresh loosing it's state
    image

Reproduction Repo

https://github.com/clumsier/turborepo-hmr-bug

@pacxiu pacxiu added area: turborepo kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage labels Apr 25, 2023
@pacxiu pacxiu closed this as completed Apr 25, 2023
@pacxiu pacxiu reopened this Apr 25, 2023
@pacxiu pacxiu changed the title [turborepo] [turborepo] HMR lost if you import shared ui package inside _app Apr 25, 2023
@pacxiu pacxiu changed the title [turborepo] HMR lost if you import shared ui package inside _app [turborepo] HMR lost if you import shared ui package inside _app and index files Apr 25, 2023
@arlyon
Copy link
Contributor

arlyon commented Apr 25, 2023

Hi! Thanks for taking the time to open an issue here. I don't believe this is an issue with turborepo or turbopack since running the next in dev mode directly via yarn causes the same issue, and you have not opted-in to using turbopack. @vercel/web-tooling could anyone weigh in on this example and confirm that that is the case?

My assumption so far is that this is an issue with transpilePackages, or another case of this issue vercel/next.js#35567

@arlyon
Copy link
Contributor

arlyon commented Apr 27, 2023

Hi, @pacxiu, I think you are best off opening this repro with https://github.com/vercel/next.js, since I don't believe this is a turbo - specific issue. I am closing this for now, thanks!

@arlyon arlyon closed this as completed Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage
Projects
None yet
Development

No branches or pull requests

2 participants