Fly.io deployment syntax error

I got the following error while deploying on Fly.io in the server logs. There is no syntax error when starting the server locally.
2024-09-30T13:42:17.991 app[56830310a09438] waw [info] > npm run validate-env && node --enable-source-maps -r dotenv/config bundle/server.js

2024-09-30T13:42:18.494 app[56830310a09438] waw [info] > [email protected] validate-env

2024-09-30T13:42:18.494 app[56830310a09438] waw [info] > node -r dotenv/config ./scripts/validate-env.mjs

2024-09-30T13:42:18.582 app[56830310a09438] waw [info] 🔍 Validating environment variables...

2024-09-30T13:42:18.849 app[56830310a09438] waw [info] /app/.wasp/out/sdk/wasp/auth/utils.ts:9

2024-09-30T13:42:18.849 app[56830310a09438] waw [info] import { Prisma } from '@prisma/client';

2024-09-30T13:42:18.849 app[56830310a09438] waw [info] ^

2024-09-30T13:42:18.849 app[56830310a09438] waw [info] SyntaxError: The requested module '@prisma/client' does not provide an export named 'Prisma'
2024-09-30T13:42:17.991 app[56830310a09438] waw [info] > npm run validate-env && node --enable-source-maps -r dotenv/config bundle/server.js

2024-09-30T13:42:18.494 app[56830310a09438] waw [info] > [email protected] validate-env

2024-09-30T13:42:18.494 app[56830310a09438] waw [info] > node -r dotenv/config ./scripts/validate-env.mjs

2024-09-30T13:42:18.582 app[56830310a09438] waw [info] 🔍 Validating environment variables...

2024-09-30T13:42:18.849 app[56830310a09438] waw [info] /app/.wasp/out/sdk/wasp/auth/utils.ts:9

2024-09-30T13:42:18.849 app[56830310a09438] waw [info] import { Prisma } from '@prisma/client';

2024-09-30T13:42:18.849 app[56830310a09438] waw [info] ^

2024-09-30T13:42:18.849 app[56830310a09438] waw [info] SyntaxError: The requested module '@prisma/client' does not provide an export named 'Prisma'
8 Replies
kapa.ai
kapa.ai3w ago
Hi @Vjeks. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- The error message you're seeing indicates that the Prisma export is not found in the @prisma/client module. This could be due to a number of reasons, such as a version mismatch or incorrect import statement. From the knowledge sources, there have been issues with Prisma version compatibility in Wasp before (source (https://github.com/wasp-lang/wasp/issues/158)). It's possible that you might be using a version of Prisma that doesn't have the Prisma export, or the way you're importing it is incorrect. You might want to check the version of Prisma you're using and ensure it's compatible with your version of Wasp. If you're unsure, you could try updating Prisma to the latest version or the version that Wasp officially supports. If the issue persists, it would be helpful to see the exact code where you're importing Prisma from @prisma/client. There might be a typo or incorrect syntax in the import statement. If you're still having trouble, I recommend reaching out to the Wasp community on their Discord server (https://discord.com/channels/686873244791210014) or opening an issue on the Wasp GitHub repository (https://github.com/wasp-lang/wasp/issues). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Vjeks, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
Vjeks
Vjeks3w ago
It isn't my code, but rather generated by wasp in the file ".wasp/out/sdk/wasp/auth/utils.ts" and it looks like this:
import { Prisma } from '@prisma/client';
import { Prisma } from '@prisma/client';
miho
miho3w ago
That's really strange, it means that somehow the Prisma client wasn't generated successfully. Please check the server logs for any signs of failed migrations or DB errors 🤔
Vjeks
Vjeks3w ago
I don't think there was any errors while deploying the server. And the following are all the server logs in 1 restart:
2024-09-30T14:17:18.431 app[4d890de9b39e28] waw [info] [ 4.714111] reboot: Restarting system

2024-09-30T14:17:18.520 app[56830310a09438] waw [info] > [email protected] validate-env

2024-09-30T14:17:18.520 app[56830310a09438] waw [info] > node -r dotenv/config ./scripts/validate-env.mjs

2024-09-30T14:17:18.615 app[56830310a09438] waw [info] 🔍 Validating environment variables...

2024-09-30T14:17:18.667 runner[4d890de9b39e28] waw [info] machine has reached its max restart count of 10

2024-09-30T14:17:18.895 app[56830310a09438] waw [info] /app/.wasp/out/sdk/wasp/auth/utils.ts:9

2024-09-30T14:17:18.895 app[56830310a09438] waw [info] import { Prisma } from '@prisma/client';

2024-09-30T14:17:18.895 app[56830310a09438] waw [info] ^

2024-09-30T14:17:18.895 app[56830310a09438] waw [info] SyntaxError: The requested module '@prisma/client' does not provide an export named 'Prisma'

2024-09-30T14:17:18.895 app[56830310a09438] waw [info] at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)

2024-09-30T14:17:18.895 app[56830310a09438] waw [info] at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)

2024-09-30T14:17:18.895 app[56830310a09438] waw [info] Node.js v18.18.0

2024-09-30T14:17:18.978 app[56830310a09438] waw [info] INFO Main child exited normally with code: 1

2024-09-30T14:17:18.992 app[56830310a09438] waw [info] INFO Starting clean up.

2024-09-30T14:17:18.993 app[56830310a09438] waw [info] WARN could not unmount /rootfs: EINVAL: Invalid argument
2024-09-30T14:17:18.431 app[4d890de9b39e28] waw [info] [ 4.714111] reboot: Restarting system

2024-09-30T14:17:18.520 app[56830310a09438] waw [info] > [email protected] validate-env

2024-09-30T14:17:18.520 app[56830310a09438] waw [info] > node -r dotenv/config ./scripts/validate-env.mjs

2024-09-30T14:17:18.615 app[56830310a09438] waw [info] 🔍 Validating environment variables...

2024-09-30T14:17:18.667 runner[4d890de9b39e28] waw [info] machine has reached its max restart count of 10

2024-09-30T14:17:18.895 app[56830310a09438] waw [info] /app/.wasp/out/sdk/wasp/auth/utils.ts:9

2024-09-30T14:17:18.895 app[56830310a09438] waw [info] import { Prisma } from '@prisma/client';

2024-09-30T14:17:18.895 app[56830310a09438] waw [info] ^

2024-09-30T14:17:18.895 app[56830310a09438] waw [info] SyntaxError: The requested module '@prisma/client' does not provide an export named 'Prisma'

2024-09-30T14:17:18.895 app[56830310a09438] waw [info] at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)

2024-09-30T14:17:18.895 app[56830310a09438] waw [info] at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)

2024-09-30T14:17:18.895 app[56830310a09438] waw [info] Node.js v18.18.0

2024-09-30T14:17:18.978 app[56830310a09438] waw [info] INFO Main child exited normally with code: 1

2024-09-30T14:17:18.992 app[56830310a09438] waw [info] INFO Starting clean up.

2024-09-30T14:17:18.993 app[56830310a09438] waw [info] WARN could not unmount /rootfs: EINVAL: Invalid argument
Filip
Filip3w ago
Gib zip @miho Feel free to investigate this if you have the time. If not, I'll pick it up next week after launching the SDK.
miho
miho3w ago
My next hunch would be failed migrations. The way we can check this is by connecting to the production DB directly and using some tool to view the _prisma_migrations table. Failed migrations usually have some log next to them. @kapa.ai how to connect to a Fly database via CLI and list of the contents of my _prisma_migrations table. Also, how do I check the list of available DBs and connect to the one I want.
kapa.ai
kapa.ai3w ago
Let me check the knowledge base for you. One moment! :books: ---------------------- To connect to your Fly database and interact with it, you can use the Fly CLI. Here are the steps: 1. Connect to the PSQL tool that Postgres uses to give commands to the DB using the Fly CLI:
fly postgres connect -a <your-db-name>

fly postgres connect -a <your-db-name>

2. To view a list of available databases, write:
\l

\l

3. To connect to your desired database, run:
\c <database-name>

\c <database-name>

4. To see the list of DB tables, execute the following:
select table_name from information_schema.tables where table_schema='public';

select table_name from information_schema.tables where table_schema='public';

5. To view the contents of your _prisma_migrations table, you can run:
SELECT * FROM _prisma_migrations;

SELECT * FROM _prisma_migrations;

Please replace <your-db-name> and <database-name> with your actual database names. These steps were discussed in a Discord support thread (https://discord.com/channels/686873244791210014/1217295340785635418) about running database migrations on a hosted app. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @miho, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
Want results from more Discord servers?
Add your server