diff --git a/packages/cli/package.json b/packages/cli/package.json index 9cf60c0c4d..655f1b5ab8 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -61,7 +61,7 @@ "ora": "^4.0.3", "raw-loader": "^4.0.1", "react": "^16.0.0", - "react-dev-utils": "^10.2.0", + "react-dev-utils": "^10.2.1", "react-hot-loader": "^4.12.21", "recursive-readdir": "^2.2.2", "replace-in-file": "^6.0.0", diff --git a/packages/cli/src/lib/bundler/server.ts b/packages/cli/src/lib/bundler/server.ts index dfb8f24f75..bf78c9b9fb 100644 --- a/packages/cli/src/lib/bundler/server.ts +++ b/packages/cli/src/lib/bundler/server.ts @@ -34,7 +34,6 @@ export async function serveBundle(options: ServeOptions) { } const protocol = yn(process.env.HTTPS, { default: false }) ? 'https' : 'http'; - const urls = prepareUrls(protocol, host, port); const paths = resolveBundlingPaths(options); const pkgPath = paths.targetPackageJson; @@ -63,6 +62,19 @@ export async function serveBundle(options: ServeOptions) { return; } + // TODO: This signature is available in 10.2.1 but doesn't have types published yet + const latestPrepareUrls = prepareUrls as ( + protocol: string, + host: string, + port: number, + path?: string, + ) => ReturnType; + const urls = latestPrepareUrls( + protocol, + host, + port, + config.output?.publicPath, + ); openBrowser(urls.localUrlForBrowser); resolve(); }); diff --git a/yarn.lock b/yarn.lock index 4f6e9ab06e..817fbe36ea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15257,7 +15257,7 @@ react-clientside-effect@^1.2.2: dependencies: "@babel/runtime" "^7.0.0" -react-dev-utils@^10.2.0: +react-dev-utils@^10.2.1: version "10.2.1" resolved "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-10.2.1.tgz#f6de325ae25fa4d546d09df4bb1befdc6dd19c19" integrity sha512-XxTbgJnYZmxuPtY3y/UV0D8/65NKkmaia4rXzViknVnZeVlklSh8u6TnaEYPfAi/Gh1TP4mEOXHI6jQOPbeakQ==