-
Notifications
You must be signed in to change notification settings - Fork 760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 BUG: service core:user:__WRANGLER_EXTERNAL_DURABLE_OBJECTS_WORKER: Worker refers to a service "core:user:worker", but no such service is defined. #7670
Comments
cc @edmundhung is working on it in #7292 🧡 @edmundhung was there any workaround in the meantime? |
Hi @flashblaze, Sorry about the unhelpful error message! The Nuxt integration relies on the getPlatformProxy API, which currently doesn’t support Durable Objects on your main worker. As a workaround, you can run your Durable Object on a separate worker and specify a |
Thanks for the help @emily-shen and @edmundhung! I'll keep the issue open for now and close this once I've got it up and running by today or tomorrow. I hope that's fine. |
I have this api route which would be turned into a worker call. I verified this since it is working after deployment. // server/api/durable-object.ts
export default defineEventHandler(async (event) => {
try {
const env = event.context.cloudflare?.env || event.context.env;
if (!env?.DUMMY_OBJECT) {
return { error: 'DUMMY_OBJECT binding not found!' };
}
const id = env.DUMMY_OBJECT.idFromName('counter');
const stub = env.DUMMY_OBJECT.get(id);
const response = await stub.fetch(event.context.cloudflare.request);
const data = await response.json() as { value: number };
return data;
}
catch (error) {
console.error(error);
return { error: 'Failed to fetch from Durable Object' };
}
}); I'm calling this route like so from my client <script setup lang="ts">
const message = ref<number | null>(null);
const error = ref<string | null>(null);
type DurableObjectResponse = {
value: number;
} | {
error: string;
};
const callDurableObject = async () => {
try {
const response = await $fetch<DurableObjectResponse>('/api/durable-object');
if ('value' in response) {
message.value = response.value;
error.value = null;
}
else {
error.value = response.error;
message.value = null;
}
}
catch (error) {
console.error(error);
}
};
</script>
<template>
<div class="space-y-4">
<div>
<Button @click="callDurableObject">
Call Durable Object
</Button>
<p v-if="message !== null" class="mt-2">
Response: {{ message }}
</p>
<p v-if="error" class="mt-2 text-red-500">
Error: {{ error }}
</p>
</div>
</div>
</template> If possible, could you guide me on how can I create a custom script in which I can call my DO with the same functionality as |
@flashblaze Did you solve this issue? |
Unfortunately no @paulius1230 |
Which Cloudflare product(s) does this pertain to?
Miniflare
What versions are you using?
3.99.0 [wrangler], 4.20241230.0, [@cloudflare/workers-types]
What operating system and version are you using?
WSL Ubuntu
Please provide a link to a minimal reproduction
No response
Describe the Bug
I'm using Nuxt with Workers Static Assets. When I deploy my app, Durable Objects work. However, it does not work in dev server.
wrangler.toml
worker-entry.mjs
worker-configuration.d.ts
package,json
nuxt.config.ts
Please provide any relevant error logs
When i run
pnpm dev
, this is the log outputThe text was updated successfully, but these errors were encountered: