Skip to content

As Title #55823

@Ancientshield

Description

@Ancientshield

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @react-native/community-cli-plugin@0.77.3 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/@react-native/community-cli-plugin/dist/commands/start/middleware.js b/node_modules/@react-native/community-cli-plugin/dist/commands/start/middleware.js
index 183ec72..65701cc 100644
--- a/node_modules/@react-native/community-cli-plugin/dist/commands/start/middleware.js
+++ b/node_modules/@react-native/community-cli-plugin/dist/commands/start/middleware.js
@@ -36,8 +36,10 @@ try {
   const communityCliServerApi = require(communityCliServerApiPath);
   communityMiddlewareFallback.createDevServerMiddleware =
     communityCliServerApi.createDevServerMiddleware;
-  communityMiddlewareFallback.indexPageMiddleware =
-    communityCliServerApi.indexPageMiddleware;
+  if (communityCliServerApi.indexPageMiddleware) {
+    communityMiddlewareFallback.indexPageMiddleware =
+      communityCliServerApi.indexPageMiddleware;
+  }
 } catch {
   debug(`⚠️ Unable to find @react-native-community/cli-server-api
 Starting the server without the community middleware.`);

This issue body was partially generated by patch-package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions