File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
packages/vite-plugin-cloudflare/src Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @cloudflare/vite-plugin " : patch
3+ ---
4+
5+ ensure that we don't crash when logging Node.js warnings when running in react-router builds
Original file line number Diff line number Diff line change @@ -734,15 +734,16 @@ export function cloudflare(pluginConfig: PluginConfig = {}): vite.Plugin[] {
734734 if ( workerConfig && ! isNodeCompat ( workerConfig ) ) {
735735 const nodeJsCompatWarnings =
736736 nodeJsCompatWarningsMap . get ( workerConfig ) ;
737- assert (
738- nodeJsCompatWarnings ,
739- `expected nodeJsCompatWarnings to be defined for Worker "${ workerConfig . name } "`
740- ) ;
737+ // TODO: re-assert this when we work out how to make it function with React Router builds.
738+ // assert(
739+ // nodeJsCompatWarnings,
740+ // `expected nodeJsCompatWarnings to be defined for Worker "${workerConfig.name}"`
741+ // );
741742 if ( nodejsBuiltins . has ( source ) ) {
742- nodeJsCompatWarnings . registerImport ( source , importer ) ;
743+ nodeJsCompatWarnings ? .registerImport ( source , importer ) ;
743744 // We don't have a natural place to trigger the rendering of the warnings
744745 // So we trigger a rendering to happen soon after this round of processing.
745- nodeJsCompatWarnings . renderWarningsOnIdle ( ) ;
746+ nodeJsCompatWarnings ? .renderWarningsOnIdle ( ) ;
746747 // Mark this path as external to avoid messy unwanted resolve errors.
747748 // It will fail at runtime but we will log warnings to the user.
748749 return {
You can’t perform that action at this time.
0 commit comments