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
requestVideoFrame polyfill is causing a error in Next.js hot-reload #6776
Comments
Even with this change in place, Next.js SSR still complains about the use of |
You're absolutely correct. I've created PR #6778 to avoid the other SSR related errors. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
Description
The requestVideoFrame.js polyfill appears to be causing Next.js hot-reload to fully reload the project:
This can be avoided by disabling SSR in Next, but the polyfill shouldn't break SSR.
The original polyfill project has a working fix for the issue: ThaUnknown/rvfc-polyfill@3fb9187
Example Test Code
This code simply forces a reference to Phaser in a Next.js project. Editing the file should force Next to hot reload the code demonstrating the error in the log.
Additional Information
Fix 1be8297 didn't quite work.
Using the latest code from https://github.com/ThaUnknown/rvfc-polyfill/blob/main/index.js appears to avoid the issue:
Change:
if (HTMLVideoElement && !('requestVideoFrameCallback' in HTMLVideoElement.prototype) && 'getVideoPlaybackQuality' in HTMLVideoElement.prototype) {
To:
if (typeof HTMLVideoElement !== 'undefined' && !('requestVideoFrameCallback' in HTMLVideoElement.prototype) && 'getVideoPlaybackQuality' in HTMLVideoElement.prototype) {
Appears to fix hot reload in an Next.js SSR build.
The text was updated successfully, but these errors were encountered: