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

Error launching dev server #1643

Closed
txk2048 opened this issue Jan 23, 2022 · 5 comments
Closed

Error launching dev server #1643

txk2048 opened this issue Jan 23, 2022 · 5 comments

Comments

@txk2048
Copy link

txk2048 commented Jan 23, 2022

What is the current behaviour?
When trying to launch dev server I get this error message: error:0308010C:digital envelope routines::unsupported

Steps to Reproduce

  1. Create a new app using the simple template.
  2. Launch the dev server

What is the expected behaviour?
The dev server to launch

Please mention any other relevant information
I am running node 17 and this bug seems similar to this bug in create-react-app

Please paste the results of npx preact-cli info here.

Environment Info:
  System:
    OS: Windows 10 10.0.19044
    CPU: (4) x64 Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz
  Binaries:
    Node: 17.3.0 - C:\Program Files\nodejs\node.EXE
    npm: 8.3.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (97.0.1072.69)
  npmPackages:
    preact: ^10.1.0 => 10.6.4
    preact-cli: ^3.0.0 => 3.3.3
    preact-render-to-string: ^5.1.2 => 5.1.19
@txk2048
Copy link
Author

txk2048 commented Jan 23, 2022

Just a note for anyone else having this issue, a temporary workaround is to use the current LTS version of Node

@rschristian
Copy link
Member

Unfortunately it's a breaking change in Node that caused pretty widespread breakages across the ecosystem. See webpack/webpack#14532

You'll need to set the NODE_OPTIONS env var to use the OpenSSL legacy provider, i.e.:

package.json

{
  "scripts": {
    "dev": "NODE_OPTIONS=--openssl-legacy-provider preact watch"
  }
}

It doesn't look like Webpack v4 will ever get fixed, so this is required if you want to use v17+.

@txk2048
Copy link
Author

txk2048 commented Jan 29, 2022

Is there any plans to upgrade preact-cli to use Webpack 5?

@rschristian
Copy link
Member

rschristian commented Jan 29, 2022

Plans? Unfortunately no.

We'd like to upgrade, but we have limited maintainers with even more limited time; upgrading Webpack is always a very time consuming process. See #1579

Edit: Well this comment is what pushed me into starting it on a Friday night, so... we're trying to get there. No idea if/when I'll get that done though.

@rschristian rschristian mentioned this issue Feb 3, 2022
Merged
@rschristian
Copy link
Member

Closing this out as it's a duplicate of #1579 essentially.

Please track that for any further updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants