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

fix(server): avoid caching .js assets in development to fix HMR for safari #9034

Merged
merged 2 commits into from
Mar 23, 2021

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented Mar 23, 2021

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)

Description

This PR turns off caching for webpack-processed JS files in dev mode.

Fixes reload loop on safari (closes #3828).
Previously, `runtime.js` was being cached in-memory by Safari and triggering infinite HMR updates in the following situation: * server started * change made to file (triggering HMR) * server restarted * safari hard reload -> starts infinite loop (because `runtime.js` from first server is loaded from memory)

Note: if you have previously experienced an infinite reload loop, you will need to clear your Safari cache once using Develop...Empty Caches and then reload.

Checklist:

  • All new and existing tests are passing.

* fixes reload loop on safari (closes #3828)
@danielroe danielroe requested a review from clarkdo March 23, 2021 11:29
@danielroe danielroe self-assigned this Mar 23, 2021
clarkdo
clarkdo previously approved these changes Mar 23, 2021
@pi0 pi0 changed the title fix(server): don't cache .js files in dev mode fix(server): avoid caching .js assets in development to fix HMR for safari Mar 23, 2021
@pi0 pi0 merged commit 1474f14 into dev Mar 23, 2021
@pi0 pi0 deleted the fix/3828-safari-infinite-reload branch March 23, 2021 18:07
enwin pushed a commit to enwin/nuxt.js that referenced this pull request Mar 25, 2021
enwin added a commit to enwin/nuxt.js that referenced this pull request Mar 25, 2021
  chore(deps): update dependency @nuxt/components to ^2.1.4 (nuxt#9037)
  chore(deps): update all non-major dependencies (nuxt#9032)
  fix(server): avoid caching `.js` assets in development to fix HMR for safari (nuxt#9034)
  fix(vue-app): re-call `$fetch` if data is missing in payload (nuxt#9026)
  chore(deps): update all non-major dependencies (nuxt#9029)
  chore(deps): update dependency node-html-parser to v3 (nuxt#8886)
  fix(config): compile type compatibility in css-loader v4 (nuxt#9014)
  chore(deps): lock file maintenance (nuxt#9023)
  fix(vue-app): handle redirect functions in routes (nuxt#9024)
  chore(deps): update dependency globby to ^11.0.3 (nuxt#9025)
  fix(vue-app): use `app.context.route` to match components in server
  chore(deps): update all non-major dependencies (nuxt#9019)
@pi0 pi0 mentioned this pull request Mar 31, 2021
@danielroe danielroe added the 2.x label Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

safari: infinite loop when hot reloading
3 participants