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

Feature: Developer guide #178

Open
albinmedoc opened this issue Nov 28, 2024 · 6 comments
Open

Feature: Developer guide #178

albinmedoc opened this issue Nov 28, 2024 · 6 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request planned

Comments

@albinmedoc
Copy link
Contributor

Is your feature request related to a problem? Please describe.
I can't manage to get the application running on my computer. I would like to add new features to the application.
I have installed Node 22 and pnpm, then I run these commands in order:

  1. pnpm install
  2. pnpm prisma generate
  3. pnpm run dev

Describe the solution you'd like
A clear and concise steps how to setup the developing environment

Additional context

PS C:\Users\al6688me\Documents\Repositories\wishlist> pnpm run dev

> wishlist@0.0.1 dev C:\Users\al6688me\Documents\Repositories\wishlist
> vite dev


  VITE v5.4.11  ready in 1798 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
  ➜  press h + enter to show help
prisma:error
Invalid `prisma.user.count()` invocation:


error: Environment variable not found: DATABASE_URL.
  -->  schema.prisma:3
   |
 2 |   provider = "sqlite"
 3 |   url      = env("DATABASE_URL")
   |

Validation Error Count: 1
PrismaClientInitializationError:
Invalid `prisma.user.count()` invocation:


error: Environment variable not found: DATABASE_URL.
  -->  schema.prisma:3
   |
 2 |   provider = "sqlite"
 3 |   url      = env("DATABASE_URL")
   |

Validation Error Count: 1
    at $n.handleRequestError (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@prisma+client@5.22.0_prisma@5.22.0\node_modules\@prisma\client\runtime\library.js:121:7615)
    at $n.handleAndLogRequestError (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@prisma+client@5.22.0_prisma@5.22.0\node_modules\@prisma\client\runtime\library.js:121:6623)
    at $n.request (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@prisma+client@5.22.0_prisma@5.22.0\node_modules\@prisma\client\runtime\library.js:121:6307)
    at async l (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@prisma+client@5.22.0_prisma@5.22.0\node_modules\@prisma\client\runtime\library.js:130:9633)
    at async load (C:\Users\al6688me\Documents\Repositories\wishlist\src\routes\login\+page.server.ts:15:23)
    at async Module.load_server_data (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@sveltejs+kit@2.8.1_@sveltejs+vite-plugin-svelte@4.0.1_svelte@5.2.3_vite@5.4.11_@types+node@2_pb5rirknwahgnoixf77ldhrq4q\node_modules\@sveltejs\kit\src\runtime\server\page\load_data.js:61:17)
    at async eval (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@sveltejs+kit@2.8.1_@sveltejs+vite-plugin-svelte@4.0.1_svelte@5.2.3_vite@5.4.11_@types+node@2_pb5rirknwahgnoixf77ldhrq4q\node_modules\@sveltejs\kit\src\runtime\server\page\index.js:156:13) {
  clientVersion: '5.22.0',
  errorCode: undefined
}
prisma:error
Invalid `prisma.user.count()` invocation:


error: Environment variable not found: DATABASE_URL.
  -->  schema.prisma:3
   |
 2 |   provider = "sqlite"
 3 |   url      = env("DATABASE_URL")
   |

Validation Error Count: 1
PrismaClientInitializationError:
Invalid `prisma.user.count()` invocation:


error: Environment variable not found: DATABASE_URL.
  -->  schema.prisma:3
   |
 2 |   provider = "sqlite"
 3 |   url      = env("DATABASE_URL")
   |

Validation Error Count: 1
    at $n.handleRequestError (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@prisma+client@5.22.0_prisma@5.22.0\node_modules\@prisma\client\runtime\library.js:121:7615)
    at $n.handleAndLogRequestError (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@prisma+client@5.22.0_prisma@5.22.0\node_modules\@prisma\client\runtime\library.js:121:6623)
    at $n.request (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@prisma+client@5.22.0_prisma@5.22.0\node_modules\@prisma\client\runtime\library.js:121:6307)
    at async l (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@prisma+client@5.22.0_prisma@5.22.0\node_modules\@prisma\client\runtime\library.js:130:9633)
    at async load (C:\Users\al6688me\Documents\Repositories\wishlist\src\routes\login\+page.server.ts:15:23)
    at async Module.load_server_data (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@sveltejs+kit@2.8.1_@sveltejs+vite-plugin-svelte@4.0.1_svelte@5.2.3_vite@5.4.11_@types+node@2_pb5rirknwahgnoixf77ldhrq4q\node_modules\@sveltejs\kit\src\runtime\server\page\load_data.js:61:17)
    at async eval (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@sveltejs+kit@2.8.1_@sveltejs+vite-plugin-svelte@4.0.1_svelte@5.2.3_vite@5.4.11_@types+node@2_pb5rirknwahgnoixf77ldhrq4q\node_modules\@sveltejs\kit\src\runtime\server\page\index.js:156:13) {
  clientVersion: '5.22.0',
  errorCode: undefined
}
SvelteKitError: Not found: /registerSW.js
    at resolve (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@sveltejs+kit@2.8.1_@sveltejs+vite-plugin-svelte@4.0.1_svelte@5.2.3_vite@5.4.11_@types+node@2_pb5rirknwahgnoixf77ldhrq4q\node_modules\@sveltejs\kit\src\runtime\server\respond.js:530:13)
    at resolve (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@sveltejs+kit@2.8.1_@sveltejs+vite-plugin-svelte@4.0.1_svelte@5.2.3_vite@5.4.11_@types+node@2_pb5rirknwahgnoixf77ldhrq4q\node_modules\@sveltejs\kit\src\runtime\server\respond.js:330:5)
    at Object.handle (C:\Users\al6688me\Documents\Repositories\wishlist\src\hooks.server.ts:9:16)
    at Module.respond (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@sveltejs+kit@2.8.1_@sveltejs+vite-plugin-svelte@4.0.1_svelte@5.2.3_vite@5.4.11_@types+node@2_pb5rirknwahgnoixf77ldhrq4q\node_modules\@sveltejs\kit\src\runtime\server\respond.js:327:40)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  status: 404,
  text: 'Not Found'
}
@albinmedoc albinmedoc added the enhancement New feature or request label Nov 28, 2024
@albinmedoc
Copy link
Contributor Author

I managed to get the application started using these commands instead:

  1. pnpm install
  2. pnpm prisma db push after I have added environment variable DATABASE_URL
  3. pnpm run dev

But when following the setup-wizard to create the first user I get this error:
image

@cmintey
Copy link
Owner

cmintey commented Nov 28, 2024

Instead of pnpm prisma db push, try pnpm prisma migrate dev

@cmintey
Copy link
Owner

cmintey commented Nov 28, 2024

Also if you'd like to implement any features, please add a comment to any existing (or create a new) feature request so I know and don't work on it as well.

@albinmedoc
Copy link
Contributor Author

Still getting the last error when following the setup wizard, user already exist...

> wishlist@0.0.1 dev /Users/al6688me/Documents/Repositories/wishlist
> vite dev


  VITE v5.4.11  ready in 941 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
  ➜  press h + enter to show help
SvelteKitError: Not found: /registerSW.js
    at resolve (/Users/al6688me/Documents/Repositories/wishlist/node_modules/.pnpm/@sveltejs+kit@2.8.1_@sveltejs+vite-plugin-svelte@4.0.1_svelte@5.2.3_vite@5.4.11_@types+node@2_pb5rirknwahgnoixf77ldhrq4q/node_modules/@sveltejs/kit/src/runtime/server/respond.js:530:13)
    at resolve (/Users/al6688me/Documents/Repositories/wishlist/node_modules/.pnpm/@sveltejs+kit@2.8.1_@sveltejs+vite-plugin-svelte@4.0.1_svelte@5.2.3_vite@5.4.11_@types+node@2_pb5rirknwahgnoixf77ldhrq4q/node_modules/@sveltejs/kit/src/runtime/server/respond.js:330:5)
    at Object.handle (/Users/al6688me/Documents/Repositories/wishlist/src/hooks.server.ts:9:16)
    at Module.respond (/Users/al6688me/Documents/Repositories/wishlist/node_modules/.pnpm/@sveltejs+kit@2.8.1_@sveltejs+vite-plugin-svelte@4.0.1_svelte@5.2.3_vite@5.4.11_@types+node@2_pb5rirknwahgnoixf77ldhrq4q/node_modules/@sveltejs/kit/src/runtime/server/respond.js:327:40)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
  status: 404,
  text: 'Not Found'
}
prisma:error 
Invalid `prisma.user.create()` invocation:


Foreign key constraint violated: `foreign key`

@cmintey
Copy link
Owner

cmintey commented Nov 28, 2024

Delete the db and run the prisma migrate dev. If it doesn't automatically run the seed command, then run pnpm prisma db seed as well

@cmintey cmintey added documentation Improvements or additions to documentation planned labels Nov 29, 2024
@cmintey cmintey self-assigned this Nov 29, 2024
@albinmedoc
Copy link
Contributor Author

Yeah, I got it working. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request planned
Projects
None yet
Development

No branches or pull requests

2 participants