you are't running wrangler there so not an issue with wrangler :p
you are't running wrangler there so not an issue with wrangler :p
wrangler dev --remote, which makes it impossible for me to fetch a Vectorize index from a service binding. That's becauseVectorize bindings are not currently supported in local mode. Please use --remote if you are working with them.


wrangler tail or using the realtime error stream on the dashboard, then repro it[Error: Cannot access `ServiceWorkerFunction` as we couldn't find a `wrangler dev` session for service "service-worker" to proxy to.] Vectorize bindings are not currently supported in local mode. Please use --remote if you are working with them.wrangler tail./node_modules/@firebase/database-compat/dist/index.standalone.js:13:1
Module not found: Can't resolve 'tls'
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module:
./node_modules/firebase-admin/lib/app/firebase-namespace.js
./node_modules/firebase-admin/lib/default-namespace.js
./node_modules/firebase-admin/lib/index.js
./app/api/(chat)/firebase/config.js
./app/api/(chat)/users/route.js
./node_modules/next/dist/build/webpack/loaders/next-edge-app-route-loader/index.js?absolutePagePath=private-next-app-dir%2Fapi%2F(chat)%2Fusers%2Froute.js&page=%2Fapi%2F(chat)%2Fusers%2Froute&appDirLoader=bmV4dC1hcHAtbG9hZGVyP25hbWU9YXBwJTJGYXBpJTJGKGNoYXQpJTJGdXNlcnMlMkZyb3V0ZSZwYWdlPSUyRmFwaSUyRihjaGF0KSUyRnVzZXJzJTJGcm91dGUmcGFnZVBhdGg9cHJpdmF0ZS1uZXh0LWFwcC1kaXIlMkZhcGklMkYoY2hhdCklMkZ1c2VycyUyRnJvdXRlLmpzJmFwcERpcj0lMkZob21lJTJGYmVhc3QlMkZEZXNrdG9wJTJGbXQtdjEtY2xvdWRmbGFyZS1wb2MlMkZhcHAmYXBwUGF0aHM9JTJGYXBpJTJGKGNoYXQpJTJGdXNlcnMlMkZyb3V0ZSZwYWdlRXh0ZW5zaW9ucz10c3gmcGFnZUV4dGVuc2lvbnM9dHMmcGFnZUV4dGVuc2lvbnM9anN4JnBhZ2VFeHRlbnNpb25zPWpzJmJhc2VQYXRoPSZhc3NldFByZWZpeD0mbmV4dENvbmZpZ091dHB1dD0mcHJlZmVycmVkUmVnaW9uPSZtaWRkbGV3YXJlQ29uZmlnPWUzMCUzRCE%3D&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D!
./node_modules/@google-cloud/firestore/build/src/index.js:19:1
Module not found: Can't resolve 'stream'
https://nextjs.org/docs/messages/module-not-foundconst lockId = env.LOCK.idFromString(`${storeId}-${data.userEmail}`);
const lock = env.LOCK.get(lockId);
const lockUrl = new URL("http://0.0.0.0/lock");
lockUrl.searchParams.set("durationSecs", "30");
const lockResponse = await lock.fetch(lockUrl.toString());
if (lockResponse.status !== 204)
return new Error("Request being processed.");async fetch(request: Request) {
const url = new URL(request.url);
switch (url.pathname) {
case "/unlock": {
await this.state.storage.delete("lock");
return new Response(null, {
status: 204,
});
}
case "/lock": {
const lockedUntil = await this.state.storage.get<number>("lock");
if (lockedUntil && lockedUntil > Date.now())
return new Response(null, {
status: 409,
});
const durationSecsString = url.searchParams.get("durationSecs");
if (!durationSecsString)
return new Response(null, {
status: 400,
});
const durationSecsNumber = parseInt(durationSecsString);
if (
!Number.isSafeInteger(durationSecsNumber) ||
durationSecsNumber <= 0
)
return new Response(null, {
status: 400,
});
await this.state.storage.put("lock", Date.now());
return new Response(null, {
status: 204,
});
}
}
}