workers-sdk
workers-sdk copied to clipboard
🐛 BUG: Cannot Wrangler Dev with D1 (NuxtJS)
What version of Wrangler
are you using?
wrangler@d1 0.0.0-7c228171
What operating system are you using?
Mac
Describe the Bug
As soon as I add the d1_database to my wrangler.toml
I get the error No matching export in ".output/server/index.mjs" for import "default"
when running npx wrangler@d1 dev
Error:
Retrieving cached values for account from node_modules/.cache/wrangler
✘ [ERROR] No matching export in ".output/server/index.mjs" for import "default"
../../../../private/var/folders/zv/hw6r8q9j365df9rl1ncgm2f80000gn/T/tmp-56345-ANj5xEsp2QnO/d1-beta-facade.entry.js:5:7:
5 │ import worker from "/Users/jjjrmy/Sites/***/.output/server/index.mjs";
wrangler.toml
d1_databases = [
{ binding="DB", database_name="***", database_id="***", preview_database_id="***" },
]
as soon as I take that out of my config file, it works
can you share the full wrangler.toml (w/o secrets) and the source code of your worker script?
@celso
name = "funnel"
workers_dev = true
compatibility_date = "2022-06-28"
main = ".output/server/index.mjs"
kv_namespaces = [
{ binding="BRANDS", id="***", preview_id="***" }
]
d1_databases = [
{ binding="DB", database_name="***", database_id="***", preview_database_id="***" },
]
[site]
bucket = ".output/public"
@JacobMGEvans how can I make a reproduction without exposing my secrets?
@JacobMGEvans how can I make a reproduction without exposing my secrets?
Fake secrets.
You must define an "export default" function
@jjjrmy I'm going to close this issue, feel free to reopen if you're still experiencing this problem!