nexus-plugin-prisma icon indicating copy to clipboard operation
nexus-plugin-prisma copied to clipboard

[Serverless] Typegen fail due to read-only file system

Open kripod opened this issue 5 years ago • 4 comments

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.

kripod avatar Nov 26 '19 00:11 kripod

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.

srisub1 avatar Feb 08 '20 07:02 srisub1

Same problem with serverless and AWS Lamba @schickling ???

kokokenada avatar Mar 19 '20 17:03 kokokenada

Actually: here's the solution: https://github.com/graphql-nexus/schema/issues/328

kokokenada avatar Mar 19 '20 18:03 kokokenada

I am hitting the same issue — does anyone have a resolution for this?

mxstbr avatar Jan 20 '21 17:01 mxstbr