Skip to content
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

Need instructions for existing workers #15343

Open
rampatra opened this issue Jun 26, 2024 · 0 comments
Open

Need instructions for existing workers #15343

rampatra opened this issue Jun 26, 2024 · 0 comments
Assignees
Labels
content:edit Request for content edits documentation Documentation edits product:d1 D1: https://developers.cloudflare.com/d1/

Comments

@rampatra
Copy link

Existing documentation URL(s)

Doc link - https://developers.cloudflare.com/d1/get-started/

This page lists nicely the steps when creating a worker from scratch but what if someone already has a worker defined and set up and are adding the D1 database to it. What node dependency to add, etc. can be mentioned.

For example, I have a nextjs app set up already and I want to add D1 database to it. So, how shall I do that?

Currently, the below is giving me an error (D1Database not found):

export interface Env {
    // If you set another name in wrangler.toml as the value for 'binding',
    // replace "DB" with the variable name you defined.
    DB: D1Database;
}

I ran this too npm install @cloudflare/workers-types @cloudflare/d1 but no luck.

What changes are you suggesting?

It should contain steps to do for existing worker.

Additional information

No response

@rampatra rampatra added content:edit Request for content edits documentation Documentation edits labels Jun 26, 2024
@github-actions github-actions bot added the product:d1 D1: https://developers.cloudflare.com/d1/ label Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content:edit Request for content edits documentation Documentation edits product:d1 D1: https://developers.cloudflare.com/d1/
Projects
None yet
Development

No branches or pull requests

6 participants