Skip to content

Commit

Permalink
Add warnings in remote mode
Browse files Browse the repository at this point in the history
  • Loading branch information
penalosa authored and joshthoward committed Sep 12, 2024
1 parent 4067303 commit 0a1224a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/wrangler/src/api/startDevWorker/ConfigController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ async function resolveConfig(
entrypoint: entry.file,
directory: entry.directory,
bindings,
migrations: input.migrations ?? config.migrations,
sendMetrics: input.sendMetrics ?? config.send_metrics,
triggers: await resolveTriggers(config, input),
env: input.env,
Expand Down Expand Up @@ -317,6 +318,18 @@ async function resolveConfig(
"Queues are currently in Beta and are not supported in wrangler dev remote mode."
);
}

if (
resolved.migrations?.some(
(m) =>
Array.isArray(m.new_sqlite_classes) && m.new_sqlite_classes.length > 0
) &&
resolved.dev?.remote
) {
throw new UserError(
"SQLite in Durable Objects is only supported in local mode."
);
}
return resolved;
}
export class ConfigController extends Controller<ConfigControllerEventMap> {
Expand Down
12 changes: 12 additions & 0 deletions packages/wrangler/src/dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,18 @@ export async function startDev(args: StartDevOptions) {
);
}

if (
args.remote &&
config.migrations?.some(
(m) =>
Array.isArray(m.new_sqlite_classes) && m.new_sqlite_classes.length > 0
)
) {
throw new UserError(
"SQLite in Durable Objects is only supported in local mode."
);
}

const projectRoot = configPath && path.dirname(configPath);

const devEnv = new DevEnv();
Expand Down

0 comments on commit 0a1224a

Please sign in to comment.