Berry: [Bug] CRA incompatibility on HTTPS=true flag

Created on 28 Jan 2020  Â·  6Comments  Â·  Source: yarnpkg/berry

Describe the bug

HTTPS=true spits this error: EROFS: read-only filesystem, open '/node_modules/webpack-dev-server/ssl/server.pem' after migrating to yarn 2.

To Reproduce

From a fresh CRA install, prepend HTTPS=true flag in the scripts.start from your package.json.

It should now look like this

scripts: {
  start: "HTTPS=true react-scripts start"
}

To clarify, yarn starts perfectly without HTTPS=true, I'm suspecting webpack-dev-server creates a self-signed certificate and writes it into its own directory, except they're all now read-only.

Environment if relevant (please complete the following information):

  • OS: OSX
  • Node version v10.16.3
  • Yarn version 2.0.0-rc.27
bug

Most helpful comment

This still produces the same error for us, yarn=2.0.0-rc.29

All 6 comments

This has been solved by adding a meta dependency on package.json:

"dependenciesMeta": {
    "webpack-dev-server": {
      "unplugged": true
    }
}

From: https://next.yarnpkg.com/configuration/manifest/#dependenciesMeta.unplugged

This still produces the same error for us, yarn=2.0.0-rc.29

2.0.0-rc.31

yarn start                                                                                                                                                                                                                     ✔  10514  21:47:09
[sudo] Passwort für arpu: 
ℹ 「wds」: Generating SSL Certificate
Error: EROFS: read-only filesystem, open '/node_modules/webpack-dev-server/ssl/server.pem'

@jacklaurencegaray should this not be reopened ?

Probably not, since it's not actionable by our team.

Webpack-dev-server seems to be mutating its own folder, which is heavily discouraged. Ideally the certificate should be stored in a node_modules dot-folder (such as node_modules/.certs), but in the meantime you can unplug the package by following the advice exposed in https://github.com/yarnpkg/berry/issues/815#issuecomment-579143792.

Did someone already open an issue for this on webpack-dev-server repo?

Was this page helpful?
0 / 5 - 0 ratings