#Having an issue running workers locally with D1

11 messages · Page 1 of 1 (latest)

tidal sage
#

Hey everyone,

I am stuck in a bit of a catch22 situation here, I have not made any changes to my code and am facing this issue, this is when I am running the worker that connects with a local d1 instance:

Issue:
✘ [ERROR] In development, you should use a separate D1 database than the one you'd use in production. Please create a new D1 database with "wrangler d1 create <name>" and add its id as preview_database_id to the d1_database "DB" in your wrangler.toml

I added preview_database_id to my wrangler.toml file and now I am getting another issue:
✘ [ERROR] Build failed with 1 error:
../../../../tmp/tmp-7680-9CpvvNjIXsPs/d1-beta-facade.entry.js:5:7: ERROR: No matching export in "src/index.ts" for import "default"

I am running the project using wrangler dev --local --persist

I have tried rebuilding my DB, deleting the folder in /tmp, stashing my changes and running the application and replacing the DB with a new DB and adding it to the toml file
Could someone please help me with this issue, any leads are appreciated?

faint violet
#

What wrangler version are you using?

tidal sage
#

Version 2.6.2

faint violet
#

:/ first time I've been that error

compact pier
tidal sage
#

It was working earlier even with D1

#

Just ran it now after a few days and it is not working

compact pier
tidal sage
#

Thanks, I raised the issue on github

#

Was not able to do anything yesterday, so skipped to the frontend for a bit 😂

pallid depot
#

See if you get the issue with 2.2.4, I also had an issue with D1 locally and downgrading solved the issue