NextJs w/ Prisma
Do i need to include the generated prisma folder when pushing to github repo? Also when doing a linting I got issues in all files inside generate folder
1 Reply
You chose to compile with the bot. One moment while I piece together your answer…
You do not need to include the generated Prisma client folder (such as /generated or /node_modules/.prisma/client) in your GitHub repository. The recommended practice is to add these generated files to your .gitignore. This is because the Prisma client is generated code that can be re-created by running prisma generate, as long as your schema.prisma and migration files are present. Including generated files in version control can cause unnecessary merge conflicts and bloat your repository.
From an official discussion:
Generated files are typically not checked into source control, but you can certainly setup your repository however you like.Why a secret .prisma folder? Regarding linting issues: Since the generated folder contains auto-generated code, it is common to see linting errors or warnings. The best approach is to configure your linter (e.g., ESLint) to ignore the generated folder. You can do this by adding the generated directory to your .eslintignore file. This prevents unnecessary linting of files you do not edit directly. In summary: - Do not commit the generated Prisma client folder to your repository. - Add the generated folder to your .gitignore and .eslintignore to avoid linting issues and keep your repo clean. Let me know if you need help configuring your .gitignore or linter! ✅ Great, thanks for letting us know that this solved your question!
Prisma generates to node_modules/.prisma by default so that it can be imported and treated like a regular package, instead of a generated one.