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

Bug: NPM error - PWA support is disabled #289

Open
jstnbr opened this issue Feb 26, 2024 · 1 comment
Open

Bug: NPM error - PWA support is disabled #289

jstnbr opened this issue Feb 26, 2024 · 1 comment

Comments

@jstnbr
Copy link

jstnbr commented Feb 26, 2024

Describe the bug
I am trying to run the dev server locally by cloning and running npm run dev, but I get an error.

To Reproduce
Steps to reproduce the behavior:

  1. Clone the repository
  2. CD into repo, and run npm install
  3. Then run npm run dev
  4. See error

Expected behavior
A dev server should be running on http://localhost:3000

After cloning the repo, I ran npm install, then I ran npm run dev. I did not change anything else, perhaps I missed a step. The output for both is below. I think the error has to do with PWA support. Here's the full output of the error I receive:

npm install output:

> [email protected] postinstall
> husky install

husky - not a Git repository, skipping hooks installation

up to date, audited 1579 packages in 3s

142 packages are looking for funding
  run `npm fund` for details

41 vulnerabilities (13 moderate, 14 high, 14 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

npm run dev output:

> [email protected] dev
> next dev

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
> [PWA] PWA support is disabled
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:69:19)
    at Object.createHash (node:crypto:133:10)
    at BulkUpdateDecorator.hashFactory (/Users/jstn/readme-so/node_modules/next/dist/compiled/webpack/bundle5.js:138971:18)
    at BulkUpdateDecorator.update (/Users/jstn/readme-so/node_modules/next/dist/compiled/webpack/bundle5.js:138872:50)
    at OriginalSource.updateHash (/Users/jstn/readme-so/node_modules/next/dist/compiled/webpack-sources3/index.js:1:10264)
    at NormalModule._initBuildHash (/Users/jstn/readme-so/node_modules/next/dist/compiled/webpack/bundle5.js:68468:17)
    at handleParseResult (/Users/jstn/readme-so/node_modules/next/dist/compiled/webpack/bundle5.js:68534:10)
    at /Users/jstn/readme-so/node_modules/next/dist/compiled/webpack/bundle5.js:68628:4
    at processResult (/Users/jstn/readme-so/node_modules/next/dist/compiled/webpack/bundle5.js:68343:11)
    at /Users/jstn/readme-so/node_modules/next/dist/compiled/webpack/bundle5.js:68407:5
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:69:19)
    at Object.createHash (node:crypto:133:10)
    at BulkUpdateDecorator.hashFactory (/Users/jstn/readme-so/node_modules/next/dist/compiled/webpack/bundle5.js:138971:18)
    at BulkUpdateDecorator.update (/Users/jstn/readme-so/node_modules/next/dist/compiled/webpack/bundle5.js:138872:50)
    at OriginalSource.updateHash (/Users/jstn/readme-so/node_modules/next/dist/compiled/webpack-sources3/index.js:1:10264)
    at NormalModule._initBuildHash (/Users/jstn/readme-so/node_modules/next/dist/compiled/webpack/bundle5.js:68468:17)
    at handleParseResult (/Users/jstn/readme-so/node_modules/next/dist/compiled/webpack/bundle5.js:68534:10)
    at /Users/jstn/readme-so/node_modules/next/dist/compiled/webpack/bundle5.js:68628:4
    at processResult (/Users/jstn/readme-so/node_modules/next/dist/compiled/webpack/bundle5.js:68343:11)
    at /Users/jstn/readme-so/node_modules/next/dist/compiled/webpack/bundle5.js:68407:5
node:internal/crypto/hash:69
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:69:19)
    at Object.createHash (node:crypto:133:10)
    at BulkUpdateDecorator.hashFactory (/Users/jstn/readme-so/node_modules/next/dist/compiled/webpack/bundle5.js:138971:18)
    at BulkUpdateDecorator.update (/Users/jstn/readme-so/node_modules/next/dist/compiled/webpack/bundle5.js:138872:50)
    at OriginalSource.updateHash (/Users/jstn/readme-so/node_modules/next/dist/compiled/webpack-sources3/index.js:1:10264)
    at NormalModule._initBuildHash (/Users/jstn/readme-so/node_modules/next/dist/compiled/webpack/bundle5.js:68468:17)
    at handleParseResult (/Users/jstn/readme-so/node_modules/next/dist/compiled/webpack/bundle5.js:68534:10)
    at /Users/jstn/readme-so/node_modules/next/dist/compiled/webpack/bundle5.js:68628:4
    at processResult (/Users/jstn/readme-so/node_modules/next/dist/compiled/webpack/bundle5.js:68343:11)
    at /Users/jstn/readme-so/node_modules/next/dist/compiled/webpack/bundle5.js:68407:5 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.17.1
@DomeT99
Copy link

DomeT99 commented Aug 30, 2024

Hi @jstnbr
I'm having the same problem too.
To fix it you should use a version of Node.js < 18.x.x (for example 16.x.x).

If you use another version, run npm install and run npm run dev, now work!

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

No branches or pull requests

2 participants