nexus-plugin-prisma
nexus-plugin-prisma copied to clipboard
[Serverless] Typegen fail due to read-only file system
While trying to deploy a GraphQL server using Netlify Functions (backed by AWS Lambda), I encountered the following issue viewable from here.
{"errorMessage":"EROFS: read-only file system, mkdir '/var/task/src/node_modules/@types/nexus-prisma-typegen'","errorType":"Error","stackTrace":["Object.mkdirsSync (/var/task/src/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js:31:9)","Object.exports.hardWriteFileSync (/var/task/src/node_modules/nexus-prisma/dist/utils.js:39:8)","doGenerate (/var/task/src/node_modules/nexus-prisma/dist/typegen.js:26:17)","Object.generateSync (/var/task/src/node_modules/nexus-prisma/dist/typegen.js:15:5)","new SchemaBuilder (/var/task/src/node_modules/nexus-prisma/dist/builder.js:92:21)","Object.build (/var/task/src/node_modules/nexus-prisma/dist/builder.js:38:21)","Object.onInstall (/var/task/src/node_modules/nexus-prisma/dist/index.js:44:34)","plugins.forEach (/var/task/src/node_modules/nexus/dist/builder.js:296:52)","Array.forEach (<anonymous>)"]}
The source code and the deployment log are also available.
I have the same problem in Google App Engine. In general, cloud (standard, not advanced) environments make the file system read-only. I had to do a GAE deploy script to move node_modules/@prisma/client to node_modules_gen/@prisma/client and change tsconfig.json to include node_modules_gen. But for this error above, i have no workaround
I would, in general, question the decision to write to node_modules, esp. considering cloud environments lock down to read-only.
Same problem with serverless and AWS Lamba @schickling ???
Actually: here's the solution: https://github.com/graphql-nexus/schema/issues/328
I am hitting the same issue — does anyone have a resolution for this?