Skip to content

Commit

Permalink
fix(startApiDev): pass accountId to startDevServer (#3109)
Browse files Browse the repository at this point in the history
* fix(startApiDev): pass `accountId` to `startDevServer`

* Update dev.tsx

* fix syntax precedence

---------

Co-authored-by: Rahul Sethi <5822355+RamIdeas@users.noreply.github.com>
  • Loading branch information
SimonDegraeve and RamIdeas authored Feb 16, 2024
1 parent 397c3ae commit ed4bf22
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/wrangler/src/dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ export type StartDevOptions = DevArguments &
// They aren't exposed as CLI arguments.
AdditionalDevProps & {
forceLocal?: boolean;
accountId?: string;
disableDevRegistry?: boolean;
enablePagesAssetsServiceBinding?: EnablePagesAssetsServiceBindingOptions;
onReady?: (ip: string, port: number, proxyData: ProxyData) => void;
Expand Down Expand Up @@ -449,7 +450,11 @@ export async function startDev(args: StartDevOptions) {
localUpstream={args.localUpstream ?? host}
localPersistencePath={localPersistencePath}
liveReload={args.liveReload || false}
accountId={configParam.account_id || getAccountFromCache()?.id}
accountId={
args.accountId ??
configParam.account_id ??
getAccountFromCache()?.id
}
assetPaths={assetPaths}
assetsConfig={configParam.assets}
initialPort={
Expand Down Expand Up @@ -575,7 +580,8 @@ export async function startApiDev(args: StartDevOptions) {
localUpstream: args.localUpstream ?? host,
localPersistencePath,
liveReload: args.liveReload ?? false,
accountId: configParam.account_id ?? getAccountFromCache()?.id,
accountId:
args.accountId ?? configParam.account_id ?? getAccountFromCache()?.id,
assetPaths: assetPaths,
assetsConfig: configParam.assets,
//port can be 0, which means to use a random port
Expand Down

0 comments on commit ed4bf22

Please sign in to comment.