Re: New app scaffold: Error: Prisma session table does not exist.

Solved

New app scaffold: Error: Prisma session table does not exist.

zhicheng1
Shopify Partner
28 2 10

I have run "npm init @Shopify/app@latest" to scaffold a new app to become a new sales channel.  However, the app generated does not work out of the box.  I have already had to modify the shopify.web.toml file to add back in missing fields to get past the first error message.

 

Now I have another error message which is "Error: Prisma session table does not exist. This could happen for a few reasons, see https://github.com/Shopify/shopify-app-js/tree/main/packages/shopify-app-session-storage-prisma#trou... for more".  I never did anything to set up Prisma but is there anything I need to do?  Someone explain this problem to me.

 

 

Accepted Solution (1)

zhicheng1
Shopify Partner
28 2 10

This is an accepted solution.

I was able to solve the problem.  You have to run the site using "npm run dev" and not "shopify app dev" now unlike in prior versions of shopify cli.  That will run the db migration which is also how the db is created in the first place.

View solution in original post

Replies 8 (8)

tanmaykejriwal
Shopify Partner
61 1 6

Hi I see your problem 

1. Did you try clearing cache npm and retrying ?

2. Deleting project and retrying ?

3. editing schema.prisma file.

 

lmk if ya need help

TK

zhicheng1
Shopify Partner
28 2 10

This is an accepted solution.

I was able to solve the problem.  You have to run the site using "npm run dev" and not "shopify app dev" now unlike in prior versions of shopify cli.  That will run the db migration which is also how the db is created in the first place.

Boris__
Shopify Partner
2 0 2

Hi, I'm facing the same issue when deploying to DigitalOcean, and other providers like fly.io seem to be working fine. Do you know what might be the issue?

 

921Kiyo
Shopify Partner
19 0 3

Did you manage to fix this? For me, it works fine in fly.io but getting "Error: Prisma session table does not exist. This could happen for
a few reasons, see https://github.com/Shopify/shopify-app-js/tree/main/packages/shopify-ap
p-session-storage-prisma#troubleshooting for more information" when running locally.

syedusama0786
Shopify Partner
47 2 12

Hey @Boris__ hope you are fine.
Did you figure it out? i am facing same issue during deploying shopify app on Heroku.

urwausman
Shopify Partner
7 0 1

@syedusama0786 I HAVE GIVEN THE SOLUTION ABOVE.

Consider it Solved! Consider it Done.
syedusama0786
Shopify Partner
47 2 12

Yes but it is for localhost but when i was getting this error after deploying my app. I wasn't deploy app through docker that's why i was getting that error but when i deployed it through docker the error was gone and the app was working fine. Now my app is working smooth and fine. Thanks for help

urwausman
Shopify Partner
7 0 1
Below is my DOCKER FILE which worked for me in heroku:
NOTE: YOU ALSO NEED TO UPDATE THE "
docker-start" script in package.json file that it must not be running prisma stuff.

FROM
node:18-alpine

 

EXPOSE 3000

 

WORKDIR /app
COPY . .

 

RUN rm -rf node_modules

 

RUN npm install
ENV NODE_ENV=production
RUN npm install --omit=dev
# RUN npm install
RUN npm install @Shopify/shopify-api@latest

 

RUN npm install mysql2
RUN npm install axios
RUN npm install @Shopify/shopify-app-session-storage-mysql@latest --force --legacy-peer-deps

 

# Remove CLI packages since we don't need them in production by default.
# Remove this line if you want to run CLI commands in your container.
RUN npm remove @Shopify/app @Shopify/cli
RUN npm run build

 

# You'll probably want to remove this in production, it's here to make it easier to test things!
# RUN rm -f prisma/dev.sqlite

 

CMD ["npm", "run", "docker-start"]
Consider it Solved! Consider it Done.