-
Notifications
You must be signed in to change notification settings - Fork 236
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
Deployment failing due to seed not working #143
Comments
|
@mcansh the main issue I see is the following. Error: Command failed with ENOENT: ts-node --require tsconfig-paths/register prisma/seed.ts I think that seems to happen because the Dockerfile only copies the node_modules that are in production dependency while the
|
This issue has been automatically marked stale because we haven't received a response from the original author in a while 🙈. This automation helps keep the issue tracker clean from issues that are not actionable. Please reach out if you have more information for us or you think this issue shouldn't be closed! 🙂 If you don't do so within 7 days, this issue will be automatically closed. |
I can confirm that Fly is not automatically seeding the DB when deploying with this stack. I've reached out to Fly support to see what can be changed. I believe the Indie Stack had a similar issue and a change was made that got it working. |
@rubys and I are already collaborating on smoothing out the deploy path with Remix in superfly/flyctl#2092, which should fix all these problems normally |
From my testing so far, removing |
@kentcdodds Can you remember why |
It's so you can import things using the |
@kentcdodds So I guess we should move Although I don't think seeding is happening in production, so it's fine to have it in |
For now I am getting around it this way:
This could probably be automated, but I still consider it a workaround and not a long term solution. The reason this compilation is necessary is because trying to |
With fly.io, seeding is run using the same image as what will be used in production. |
@rubys Should we create another build for doing so? |
On fly.io, build machines don't have access to secrets or postgres databases. Looking at the prisma documentation, it looks like seeds aren't applied on the first In any case, the way it works out is that the only place where you can run your seed script on fly.io machines is on a machine that is set up for production. |
Have you experienced this bug with the latest version of the template?
Yes
Steps to Reproduce
Running the CI/CD pipeline through github actions or the
fly deploy
and then I get error that results in failure of deployment.Expected Behavior
Deployment works and seeding succeeds
Actual Behavior
Looks like as the "prisma.seed" in the package.json and using ts-node while the Dockerfile in production image doesn't have ts-node so it just fails. I couldn't find where the prisma seed is being invoked from either in docker file or elsewhere so not sure what needs to be moved where.
The text was updated successfully, but these errors were encountered: