Shopify / shopify-app-template-remix

322 stars 134 forks source link

when i use prisma client using mongodb as datasource it will give error #748

Closed ShubhamConversios closed 2 months ago

ShubhamConversios commented 2 months ago

Issue summary

Before opening this issue, I have:

Expected behavior

app will run and give the preview link for the preview What do you think should happen?

Actual behavior

What actually happens? ── external error ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Error coming from npx prisma migrate deploy

Command failed with exit code 1: npx prisma migrate deploy Error: The "mongodb" provider is not supported with this command. For more info see https://www.prisma.io/docs/concepts/database-connectors/mongodb 0: schema_core::state::ApplyMigrations at schema-engine/core/src/state.rs:226

Environment variables loaded from .env Prisma schema loaded from prisma/schema.prisma Datasource "db": MongoDB database "productfeed" at "shubham.9ywagx5.mongodb.net"

No migration found in prisma/migrations

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Steps to reproduce the problem

1. 1. 1.

Debug logs

shopify app dev --tunnel-url=https://0bbb-61-1-53-134.ngrok-free.app:8080 ╭─ info ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ │ │ Using shopify.app.toml: │ │ │ │ • Org: Developer conversios.io │ │ • App: shubham app test1 │ │ • Dev store: shubham-app-test1.myshopify.com │ │ • Update URLs: Yes │ │ │ │ You can pass --reset to your command to reset your app configuration. │ │ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

16:37:31 │ graphiql │ GraphiQL server started on port 3457 16:37:32 │ remix │ Environment variables loaded from .env 16:37:32 │ remix │ Prisma schema loaded from prisma/schema.prisma 16:37:32 │ remix │ 16:37:32 │ remix │ ✔ Generated Prisma Client (v5.15.0) to ./node_modules/@prisma/client in 44ms 16:37:32 │ remix │ 16:37:32 │ remix │ Start using Prisma Client in Node.js (See: https://pris.ly/d/client) 16:37:32 │ remix │ 16:37:32 │ remix │ import { PrismaClient } from '@prisma/client' 16:37:32 │ remix │ const prisma = new PrismaClient() 16:37:32 │ remix │ 16:37:32 │ remix │ or start using Prisma Client at the edge (See: https://pris.ly/d/accelerate) 16:37:32 │ remix │ 16:37:32 │ remix │ import { PrismaClient } from '@prisma/client/edge' 16:37:32 │ remix │ const prisma = new PrismaClient() 16:37:32 │ remix │ 16:37:32 │ remix │ 16:37:32 │ remix │ See other ways of importing Prisma Client: http://pris.ly/d/importing-client 16:37:32 │ remix │ 16:37:32 │ remix │ ┌─────────────────────────────────────────────────────────────┐ 16:37:32 │ remix │ │ Deploying your app to serverless or edge functions? │ 16:37:32 │ remix │ │ Try Prisma Accelerate for connection pooling and caching. │ 16:37:32 │ remix │ │ https://pris.ly/cli/--accelerate │ 16:37:32 │ remix │ └─────────────────────────────────────────────────────────────┘ 16:37:32 │ remix │ 16:37:33 │ remix │ Environment variables loaded from .env 16:37:33 │ remix │ Prisma schema loaded from prisma/schema.prisma 16:37:33 │ remix │ Datasource "db": MongoDB database "productfeed" at "shubham.9ywagx5.mongodb.net" 16:37:33 │ remix │ 16:37:33 │ remix │ No migration found in prisma/migrations 16:37:33 │ remix │ 16:37:33 │ remix │ Error: The "mongodb" provider is not supported with this command. For more info see https://www.prisma.io/docs/concepts/database-connectors/mongodb 16:37:33 │ remix │ 0: schema_core::state::ApplyMigrations 16:37:33 │ remix │ at schema-engine/core/src/state.rs:226 16:37:33 │ remix │

── external error ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Error coming from npx prisma migrate deploy

Command failed with exit code 1: npx prisma migrate deploy Error: The "mongodb" provider is not supported with this command. For more info see https://www.prisma.io/docs/concepts/database-connectors/mongodb 0: schema_core::state::ApplyMigrations at schema-engine/core/src/state.rs:226

Environment variables loaded from .env Prisma schema loaded from prisma/schema.prisma Datasource "db": MongoDB database "productfeed" at "shubham.9ywagx5.mongodb.net"

No migration found in prisma/migrations

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Screenshot from 2024-06-18 16-48-31

it will complettly run with the sqlite but when i use with the mongodb as datasource it will give me the error but when i use the npx prisma db push it will create collection in the database but with the shopify app it will not run

matteodepalo commented 2 months ago

Hi @ShubhamConversios thank you for opening this issue. This doesn't look like an issue with the template itself but rather with getting Prisma to work with MongoDB, so I'm going to close it.

dkalariya commented 2 months ago

same issue occur when im try to migrate sqlLite to mongodb ..and when im try to run shopify app dev --tunnel-url=https://b96e-180-211-99-158.ngrok-free.app:4400 this command shopify app store is not open and give error like below atached screenShot Screenshot from 2024-06-19 11-48-03

mracy commented 2 weeks ago

I think go to shopify.web.toml and in dev put this command [ dev = "npx prisma db push && npm exec remix vite:dev"]