Skip to content

[dev-tools] assert types for dev overlay entries #79656

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

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ export async function fetchServerResponse(
// In dev, the Webpack runtime is minimal for each page.
// We need to ensure the Webpack runtime is updated before executing client-side JS of the new page.
if (process.env.NODE_ENV !== 'production' && !process.env.TURBOPACK) {
await require('../react-dev-overlay/app/hot-reloader-client').waitForWebpackRuntimeHotUpdate()
await (
require('../react-dev-overlay/app/hot-reloader-client') as typeof import('../react-dev-overlay/app/hot-reloader-client')
).waitForWebpackRuntimeHotUpdate()
}

// Handle the `fetch` readable stream that can be unwrapped by `React.use`.
Expand Down
6 changes: 3 additions & 3 deletions packages/next/src/client/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ class Container extends React.Component<{
if (process.env.NODE_ENV === 'production') {
return this.props.children
} else {
const {
PagesDevOverlay,
}: typeof import('./components/react-dev-overlay/pages/pages-dev-overlay') = require('./components/react-dev-overlay/pages/pages-dev-overlay')
const PagesDevOverlay =
require('./components/react-dev-overlay/pages/pages-dev-overlay')
.PagesDevOverlay as typeof import('./components/react-dev-overlay/pages/pages-dev-overlay').PagesDevOverlay
return <PagesDevOverlay>{this.props.children}</PagesDevOverlay>
}
}
Expand Down
Loading