question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Schema File Not Found

See original GitHub issue

Bug description

Prisma can’t find the schema file (schema.prisma). The client can’t be used.

Error message:

error - Error: ENOENT: no such file or directory, open '...\.next\cache\webpack\client-development\schema.prisma'

How to reproduce

  1. Clone https://github.com/MatsG23/prisma-reproducible-example
  2. Run yarn prisma generate
  3. Run yarn dev
  4. Click on the link NextJS gives you

Expected behavior

It should find the schema file.

Prisma information

I set a custom output directory but also import the client from there (how it should be).

Environment & setup

  • OS: Windows
  • Database: default values - not even trying to connect
  • Node.js version: 17.1.0
  • NextJS version: 12.0.4 (uses Webpack 5 and SWC)

Prisma Version

prisma                  : 3.5.0
@prisma/client          : 3.5.0
Current platform        : windows
Query Engine (Node-API) : libquery-engine 78a5df6def6943431f4c022e1428dbc3e833cf8e (at node_modules\@prisma\engines\query_engine-windows.dll.node)
Migration Engine        : migration-engine-cli 78a5df6def6943431f4c022e1428dbc3e833cf8e (at node_modules\@prisma\engines\migration-engine-windows.exe)
Introspection Engine    : introspection-core 78a5df6def6943431f4c022e1428dbc3e833cf8e (at node_modules\@prisma\engines\introspection-engine-windows.exe)
Format Binary           : prisma-fmt 78a5df6def6943431f4c022e1428dbc3e833cf8e (at node_modules\@prisma\engines\prisma-fmt-windows.exe)
Default Engines Hash    : 78a5df6def6943431f4c022e1428dbc3e833cf8e
Studio                  : 0.439.0

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:6
  • Comments:23 (6 by maintainers)

github_iconTop GitHub Comments

8reactions
t3dotggcommented, Oct 20, 2022

@roxkstar74 this is absolute chaos and I respect you immensely

Prisma homies, let’s get this one fixed 🙏 happy to get y’all in touch w/ Turborepo folks during NextConf

7reactions
lottamuscommented, Nov 6, 2022

If you’re using nextjs, try adding prisma to the serverComponentsExternalPackages in your config:

// next.config.js
const nextConfig = {
  experimental: {
    appDir: true,
    serverComponentsExternalPackages: ['@prisma/client'],
  },
};

https://beta.nextjs.org/docs/api-reference/next.config.js#servercomponentsexternalpackages

image
Read more comments on GitHub >

github_iconTop Results From Across the Web

XML schema not found even if specified in file - Stack Overflow
Okay, I found a workaround, I could just specific add the schema from the url to the xsd, it's not perfect but I...
Read more >
"Schema file not found" when running setup-sca or setup-sdp
If the packages are installed without the documentation, then these files will not be present on the system and the utility will fail....
Read more >
Schema not found Error when loading XML File - webMethods
Hi there, I defined a Schema in my Tamino DB, but now when I try to load an XML into the defined Collection...
Read more >
Schema not found while attempting to validate XML - SSDN
Subject: Schema not found while attempting to validate XML Author: Doug McCall. Date: 17 Jun 2003 04:20 PM. Hi, I've got an XML...
Read more >
Schema file not found in Payload - SAP Community
master-data-payload-error.png master-data-payload-error.pngI have run ARBCIG_MASTER_DATA_EXPORT from se38 and transaction is received with a ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found