Full page reload when saving locally
Unanswered
Red-whiskered Bulbul posted this in #help-forum
Red-whiskered BulbulOP
I have a monorepo using yarn workspaces and turbo. There are two main apps, a Next.js app and an Expo app, and they both use a shared UI in a workspace called "marketplace-ui".
- apps/native
- apps/web
- packages/marketplace-ui
When I save a file in the marketplace-ui repo that the Next.js app is using, Fast Refresh updates the page and then performs a full page reload as well. Everything works as expected in the Expo app (as long as I don't export multiple variables in the same file). Fast Refresh also works fine when updating files within the Next.js web app.
I've been going back and fourth with the setup of the package.json in the marketplace-ui in order to fix the full page reload. Currently, it only has a "main" field with "src/index.ts". I've tried using exports, module and files as well, without luck.
The marketplace-ui is being transpiled by next.
I'm using the pages router, Next.js version 14.2.2.
- apps/native
- apps/web
- packages/marketplace-ui
When I save a file in the marketplace-ui repo that the Next.js app is using, Fast Refresh updates the page and then performs a full page reload as well. Everything works as expected in the Expo app (as long as I don't export multiple variables in the same file). Fast Refresh also works fine when updating files within the Next.js web app.
I've been going back and fourth with the setup of the package.json in the marketplace-ui in order to fix the full page reload. Currently, it only has a "main" field with "src/index.ts". I've tried using exports, module and files as well, without luck.
The marketplace-ui is being transpiled by next.
I'm using the pages router, Next.js version 14.2.2.
2 Replies
Red-whiskered BulbulOP
Some progress. If I remove everything from our src/index.ts file (the barrel file), except for a single component, everything works as expected.
I had to comment out a bunch of code in order for it to work. But keeping the commented code out and re-adding the exports in the barrel file, breaks it again.
I had to comment out a bunch of code in order for it to work. But keeping the commented code out and re-adding the exports in the barrel file, breaks it again.
Red-whiskered BulbulOP
Turns out that it is only happening when I use "styled" from the dripsy library I'm using for responsive styling 😢