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

Prisma generate --watch errors Error: write EPIPE #1816

Closed
malekjaroslav opened this issue Mar 11, 2020 · 4 comments
Closed

Prisma generate --watch errors Error: write EPIPE #1816

malekjaroslav opened this issue Mar 11, 2020 · 4 comments
Assignees
Labels
bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/regression A reported bug in functionality that used to work before. tech/typescript Issue for tech TypeScript. topic: prisma generate CLI: prisma generate
Milestone

Comments

@malekjaroslav
Copy link

When running prisma generate --watch, this error sometimes kills it:

node_modules/prisma2/build/index.js:2
module.exports=function(e,t){"use strict";var r={};function __webpack_require__(t){if(r[t]){return r[t].exports}var n=r[t]={i:t,l:false,exports:{}};e[t].call(n.exports,n,n.exports,__webpack_require__);n.l=true;return n.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(4653)}t(__webpack_require__);return startup()}({2:function(e,t,r){"use strict";var n=r(5622);var i=r(3382);var o=r(7707);var s=r(2080);e.exports=function(e,t){if(typeof e!=="string"){t=e;e=null}var r=o({cwd:process.cwd()},t);e=e||r.type;var u=n.resolve(r.cwd,".git/config");if(e==="global"){u=n.join(s(),".gitconfig")}if(!i(u)){if(typeof e==="string"){return null}u=n.join(s(),".config/git/config")}return i(u)?u:null}},9:function(e,t){"use strict";const r=t.encode=((e,t)=>{if(!Number.isSafeInteger(e))throw Error("cannot encode number outside of javascript safe integer range");else if(e<0)i(e,t);else n(e,t);return t});c

Error: write EPIPE
    at WriteWrap.afterWrite [as oncomplete] (net.js:789:14)
error Command failed with exit code 7.
@janpio janpio added topic: prisma generate CLI: prisma generate bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. kind/bug A reported bug. labels Mar 11, 2020
@pantharshit00
Copy link
Contributor

pantharshit00 commented Mar 16, 2020

I can confirm this.

Steps for reproduction:

  1. Bootstrap an empty Prisma 2 project
  2. Add the following model:
    // This is your Prisma schema file,
    // learn more about it in the docs: https://pris.ly/d/prisma-schema
    
    datasource db {
      provider = "postgresql"
      url      = env("DATABASE_URL")
    }
    
    generator client {
      provider = "prisma-client-js"
    }
    
    model User {
      id String @id @default(cuid())
      name String
    }
  3. Run prisma2 generate --watch
  4. Change your model to the following:
    // This is your Prisma schema file,
    // learn more about it in the docs: https://pris.ly/d/prisma-schema
    
    datasource db {
      provider = "postgresql"
      url      = env("DATABASE_URL")
    }
    
    generator client {
      provider = "prisma-client-js"
    }
    
    model User {
      id String @id @default(cuid())
      name String
      test String
    }
  5. See the error.

From my investigation so far, this only happens if your generate run creates a package.json file.

Version: prisma2@2.0.0-preview024, binary version: 377df4fe30aa992f13f1ba152cf83d5770bdbc85

@pantharshit00 pantharshit00 added bug/2-confirmed Bug has been reproduced and confirmed. kind/regression A reported bug in functionality that used to work before. and removed bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. kind/bug A reported bug. labels Mar 16, 2020
@janpio janpio added this to the Preview 25 milestone Mar 16, 2020
@janpio janpio modified the milestones: Preview 25, Foo 1, Foo 2 Mar 26, 2020
@Jolg42 Jolg42 added the tech/typescript Issue for tech TypeScript. label Apr 14, 2020
@janpio janpio modified the milestones: Beta Backlog, Beta 4 Apr 21, 2020
@divyenduz divyenduz modified the milestones: Beta 4, Beta 5 May 4, 2020
@janpio janpio modified the milestones: Beta 5, Beta 6 May 12, 2020
@Jolg42
Copy link
Member

Jolg42 commented May 19, 2020

It looks like I can't reproduce it. (in latest alpha)

I'm closing it for now, feel free to comment here if you think it's still an issue 😃

@Jolg42 Jolg42 closed this as completed May 19, 2020
@Jolg42
Copy link
Member

Jolg42 commented May 28, 2020

It just happened to me on macOS I will try to get a clear reproduction.

Schema parsing
error: Error validating: This line is invalid. It does not start with any known Prisma schema keyword.
  -->  schema.prisma:22
   | 
21 | //   id Int @id
22 | }
23 | 
   | 

Validation Error Count: 1

✔ Generated Prisma Client to ./@prisma/client in 37ms
✔ Generated Prisma Client to ./@prisma/client in 33ms

/Users/j42/Dev/prisma/src/node_modules/.pnpm/registry.npmjs.org/yoga-layout-prebuilt/1.9.5/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

Error: write EPIPE
    at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:87:16)
Emitted 'error' event on Socket instance at:
    at errorOrDestroy (internal/streams/destroy.js:108:12)
    at onwriteError (_stream_writable.js:456:5)
    at onwrite (_stream_writable.js:477:5)
    at internal/streams/destroy.js:50:7
    at Socket._destroy (net.js:669:5)
    at Socket.destroy (internal/streams/destroy.js:38:8)
    at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:88:12) {
  errno: 'EPIPE',
  code: 'EPIPE',
  syscall: 'write'
}

@Jolg42 Jolg42 reopened this May 28, 2020
@Jolg42 Jolg42 removed this from the Beta 6 milestone May 28, 2020
@Jolg42 Jolg42 added this to the Beta 7 milestone May 28, 2020
@Jolg42 Jolg42 changed the title Prisma generate --watch errors Prisma generate --watch errors Error: write EPIPE May 28, 2020
@janpio janpio modified the milestones: Beta 7, Beta 8 May 29, 2020
@janpio janpio added bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. and removed bug/2-confirmed Bug has been reproduced and confirmed. labels Jun 10, 2020
@janpio janpio modified the milestones: Beta 10, 2.1.0 Jun 10, 2020
@Jolg42
Copy link
Member

Jolg42 commented Jun 23, 2020

Closing for now as I couldn't get a proper reproduction. So if anyone can reproduce in a reliable way that would be great 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/regression A reported bug in functionality that used to work before. tech/typescript Issue for tech TypeScript. topic: prisma generate CLI: prisma generate
Projects
None yet
Development

No branches or pull requests

6 participants