Closed larrycenter2006 closed 4 months ago
@larrycenter2006 I have the same error when I am try to run the app with the npm run dev
@larrycenter2006 I have the same error when I am try to run the app with the
npm run dev
See this link https://github.com/Shopify/shopify-app-template-remix/issues/285#issuecomment-1700603930
I have the same issue when I try to run the app with the npm run dev
.
I have the same issue when I try to run the app with the
npm run dev
.
Please refer to this link for the Solution https://github.com/Shopify/shopify-app-template-remix/issues/285#issuecomment-1700603930
Hi folks 👋
Glad that the commenter was able to explain what the issue was.
We have updated our readme's with some information about this and linking to the Prisma documentation about the configuring MongoDB.
when im try to run my shopify app using this command:shopify app dev --tunnel-url=https://b96e-180-211-99-158.ngrok-free.app:4400 .giving error like Error: The "mongodb" provider is not supported with this command after im converting the sqlLite to mongodb databse .for more info im atteched scrennshot of my error below ![Uploading Screenshot from 2024-06-19 11-48-03.png…]()
@dkalariya Please review our documentation.
Hi @lizkenyon,
I found the documentation quite confusing it might be outdated, too. I'd like to update the Readme (see https://github.com/Shopify/shopify-app-template-remix/pull/764). The following solution works for me:
Update the shopify.web.toml
file and modify the predev
and dev
command to
[commands]
predev = "npx prisma generate && npx prisma db push"
dev = "npm exec remix vite:dev"
npm run dev
and shopify app dev
fail with the message
Error: The "mongodb" provider is not supported with this command.
See this link https://github.com/Shopify/shopify-app-template-remix/issues/285#issuecomment-1700603930
Please refer to this link for the Solution https://github.com/Shopify/shopify-app-template-remix/issues/285#issuecomment-1700603930
tells you
You have to update the predev command in package.json. Since mongo is not a relational database the migrate command is going to fail. So to sync the schema with the db you can run npx prisma db push or add it the predev command in package.json scripts.
This is not true because package.json
uses the shopify-cli
that is responsible for executing
[commands]
dev = "npx prisma generate && npx prisma migrate deploy && npm exec remix vite:dev"
So adding/changing predev
in the package.json
will still execute shopify app dev
executing npx prisma migrate deploy
and resulting in the original issue
@dkalariya Please review our documentation.
which forwards you to
MongoDB does not support the prisma migrate command. If you are using MongoDB please see the Prisma documentation for more information.
which tells you
No support for Prisma Migrate Currently, there are no plans to add support for Prisma Migrate as MongoDB projects do not rely on internal schemas where changes need to be managed with an extra tool. Management of @unique indexes is realized through db push.
okay, but it doesn't tell how to fix it for Shopify apps
In my schema.prisma file I have made some changes as per the Shopify and prisma documentation
datasource db { provider = "mongodb" url = env("DATABASE_URL") }
generator client { provider = "prisma-client-js" }
model Session { id String @id @default(auto()) @map("_id") @db.ObjectId shop String state String isOnline Boolean @default(false) scope String? expires DateTime? accessToken String userId Int? }
and when access "npm run dev" i get Error: The "mongodb" provider is not supported with this command. I mention that I made the .env correctly (mongodb atlas).
Where do I go wrong in setting up new databases or where is the problem?