Skip to content
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

switched to this project, dev works, but build doesn't #56

Open
husayt opened this issue Nov 14, 2024 · 6 comments
Open

switched to this project, dev works, but build doesn't #56

husayt opened this issue Nov 14, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@husayt
Copy link

husayt commented Nov 14, 2024

Before I was using prisma with nuxt directly, Dev was working fine, but to build a server bundle I had my own setup and some after build script

copy .env  .output\server

rem move myrpisma outside from node_modules
move .output\server\node_modules\myprisma .output\server\myprisma

Rem this file is not needed for linux
del .output\server\myprisma\client\query_engine-windows.dll.node

rem copy database file to dist folder
copy ..\prisma\dev.db .output\server\myprisma\client

powershell -Command "(gc .output\server\package.json) -replace '0.0.0', 'file:../myprisma' -replace 'win32-x64-msvc', 'linux-x64-gnu' | Out-File -encoding ASCII .output\server\package.json"

rem Replace inside `.output/server` all 'myprisma/client' to '../myprisma/client/index.js'
node fileReplacer.js

Obviously that was painful, so I switched to using nuxt-prisma module to have smoother use. I managed to get dev working with

nuxi dev --dotenv .env.local

but can't even get local build running properly.
I get build completed with these warnings
image
then when i run with node .output/server/index.mjs it can't find database, but if I copy sqlite database file to output folder and run like this it works:
image

Is there anything I am missing, i expect it to copy database file to output folder. Or is this as expected?

@ankur-arch ankur-arch self-assigned this Nov 14, 2024
@ankur-arch
Copy link
Contributor

Hey @husayt 👋 , thanks for reporting the issue.

Obviously that was painful, so I switched to using nuxt-prisma module to have smoother use. I managed to get dev working with

I'm sorry you had to experience that.

Is there anything I am missing, i expect it to copy database file to output folder. Or is this as expected?

This is not expected. Could you check if this helps resolve the issue?

@ankur-arch ankur-arch added the bug Something isn't working label Nov 14, 2024
@husayt
Copy link
Author

husayt commented Nov 14, 2024

This is not expected. Could you check if this helps resolve the issue?

I have tried that and now get this error when running from build and it crashes completely in browser
image

@ankur-arch
Copy link
Contributor

Thanks for getting back.

I have tried that and now get this error when running from build and it crashes completely in browser

I haven't seen the exact message before. I'd appreciate it if you provide me with a small reproduction of the issue.

@husayt
Copy link
Author

husayt commented Nov 14, 2024

and this is what Firebase gives when trying to deploy there:

Build failed with status: FAILURE and message: npm error code EINVALIDPACKAGENAME npm error Invalid package name ".prisma" of package "[email protected]": name cannot start with a period.

@ankur-arch
Copy link
Contributor

Thanks @husayt, could you kindly provide a reproduction I can use to replicate the exact errors? Additionally, is there any custom configuration I should be aware of?

@husayt
Copy link
Author

husayt commented Nov 15, 2024

Yes, you are right. I am trying to come up with a small reproduction and will let you know once it is ready.

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants