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(vue-app): call ssrContext.unsetMutationObserver only if it exists #10132

Merged
merged 2 commits into from Dec 17, 2021
Merged

fix(vue-app): call ssrContext.unsetMutationObserver only if it exists #10132

merged 2 commits into from Dec 17, 2021

Conversation

reegodev
Copy link

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Resolves: #10131
ssrContext.unsetMutationObserver is set after router middleware are evaluated. This causes a problem because if a middleware calls error, then the app calls renderErrorPage which in turns calls ssrContext.unsetMutationObserver() in the beforeRender function, causing an error.

https://github.com/nuxt/nuxt.js/blob/dev/packages/vue-app/template/server.js#L137
https://github.com/nuxt/nuxt.js/blob/dev/packages/vue-app/template/server.js#L209
https://github.com/nuxt/nuxt.js/blob/dev/packages/vue-app/template/server.js#L216

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly. (PR: #)
  • I have added tests to cover my changes (if not applicable, please state why)
  • All new and existing tests are passing.

@codecov-commenter
Copy link

codecov-commenter commented Dec 13, 2021

Codecov Report

Merging #10132 (d7848cf) into dev (c1d02ea) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev   #10132   +/-   ##
=======================================
  Coverage   65.15%   65.15%           
=======================================
  Files          94       94           
  Lines        4155     4155           
  Branches     1172     1172           
=======================================
  Hits         2707     2707           
  Misses       1169     1169           
  Partials      279      279           
Flag Coverage Δ
unittests 65.15% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c1d02ea...d7848cf. Read the comment docs.

Co-authored-by: Daniel Roe <daniel@roe.dev>
@danielroe danielroe requested a review from pi0 December 15, 2021 11:17
Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@pi0 pi0 merged commit 777a4b7 into nuxt:dev Dec 17, 2021
@pi0 pi0 mentioned this pull request Jun 23, 2022
@danielroe danielroe added the 2.x label Jan 18, 2023
@danielroe danielroe mentioned this pull request Jan 19, 2023
@danielroe danielroe mentioned this pull request Feb 1, 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.

calling error from a middleware generates a TypeError in full static mode
4 participants