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(nuxt): make onNuxtReady safe to run on server-side #18706

Merged
merged 1 commit into from
Feb 2, 2023
Merged

Conversation

danielroe
Copy link
Member

πŸ”— Linked issue

resolves #18696

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

As we didn't provide a stub for requestIdleCallback on server, onNuxtReady wasn't safe to call in SSR. This PR changes that, making the behaviour explicit: onNuxtReady will not call the callback at all on server side.

It also adds stub functions for idle callback support on server.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codesandbox
Copy link

codesandbox bot commented Feb 2, 2023

CodeSandbox logoCodeSandbox logoΒ  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@danielroe danielroe merged commit cb0860b into main Feb 2, 2023
@danielroe danielroe deleted the fix/idle branch February 2, 2023 13:27
@danielroe danielroe mentioned this pull request Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

__vite_ssr_import_1__.requestIdleCallback is not a function when using onNuxtReady composable
2 participants