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

webpack 4: yarn fails when using nodejs 18 #23696

Closed
Kunsi opened this issue Nov 4, 2022 · 8 comments
Closed

webpack 4: yarn fails when using nodejs 18 #23696

Kunsi opened this issue Nov 4, 2022 · 8 comments
Labels
A-Developer-Experience O-Occasional Affects or can be seen by some users regularly or most users rarely S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect

Comments

@Kunsi
Copy link

Kunsi commented Nov 4, 2022

Steps to reproduce

  • Install nodejs 18
  • run yarn install && yarn build in repo directory
  • get error: Error: error:0308010C:digital envelope routines::unsupported

Outcome

│ Error: error:0308010C:digital envelope routines::unsupported
│     at new Hash (node:internal/crypto/hash:71:19)
│     at Object.createHash (node:crypto:133:10)
│     at module.exports (/opt/element-web/node_modules/webpack/lib/util/createHash.js:135:53)
│     at NormalModule._initBuildHash (/opt/element-web/node_modules/webpack/lib/NormalModule.js:417:16)
│     at handleParseError (/opt/element-web/node_modules/webpack/lib/NormalModule.js:471:10)
│     at /opt/element-web/node_modules/webpack/lib/NormalModule.js:503:5
│     at /opt/element-web/node_modules/webpack/lib/NormalModule.js:358:12
│     at /opt/element-web/node_modules/loader-runner/lib/LoaderRunner.js:373:3
│     at iterateNormalLoaders (/opt/element-web/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
│     at iterateNormalLoaders (/opt/element-web/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
│     at /opt/element-web/node_modules/loader-runner/lib/LoaderRunner.js:236:3
│     at context.callback (/opt/element-web/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
│     at /opt/element-web/node_modules/babel-loader/lib/index.js:59:71 {
│   opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
│   library: 'digital envelope routines',
│   reason: 'unsupported',
│   code: 'ERR_OSSL_EVP_UNSUPPORTED'
│ }
│
│ Node.js v18.12.0

Operating system

debian stable

Browser information

No response

URL for webapp

No response

Application version

1.11.13

Homeserver

No response

Will you send logs?

No

@Kunsi Kunsi added the T-Defect label Nov 4, 2022
@weeman1337 weeman1337 added S-Major Severely degrades major functionality or product features, with no satisfactory workaround A-Developer-Experience O-Occasional Affects or can be seen by some users regularly or most users rarely labels Nov 4, 2022
@weeman1337
Copy link
Contributor

weeman1337 commented Nov 4, 2022

Thanks for reporting the issue @Kunsi . I can reproduce this one on Ubuntu 22.04.1 LTS.

Found this webpack issue: webpack/webpack#14532
As a workaround see the comments there. For a real solution looks like we need to upgrade to webpack 5.

@t3chguy
Copy link
Member

t3chguy commented Nov 4, 2022

I've been using Node 18 just fine on macOS installed from homebrew

@pvagner
Copy link
Contributor

pvagner commented Nov 21, 2022

I am now using nodejs 19 on arch linux and I think the issue is not with nodejs as such but it might have to do something with upgrading openssl to version 3.0 I guess.
As per the webpack issue, I am running

export NODE_OPTIONS=--openssl-legacy-provider

before yarn dist and it works so far.

@globi84
Copy link

globi84 commented Jan 23, 2023

under windows does it not work or do I something wrong

my batchfile looks like this

set NODE_OPTIONS=--openssl-legacy-provider
echo "load enviroment..."
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\VC\Auxiliary\Build\vcvars64.bat"


echo "update rust and cargo"
rustup install stable
rustup default stable

echo "yarn install..."
call yarn install

echo "yarn fetch..."
call yarn run fetch --noverify --cfgdir CONFIGFILE

echo "yarn build native..."
call yarn run build:native

echo "yarn build 64..."
call yarn run build:64

@felipeavilis
Copy link

felipeavilis commented Feb 28, 2023

#23696 (comment)

Where should i add this line? Witch file?

@t3chguy t3chguy changed the title yarn fails when using nodejs 18 webpack 4: yarn fails when using nodejs 18 Mar 1, 2023
@lamhungypl
Copy link

Try yarn upgrade.
In my case, there's only 1 issue with @babel/plugin-proposal-private-property-in-object and it can be easily fixed by adding to devDependencies

@t3chguy
Copy link
Member

t3chguy commented Oct 13, 2023

No longer an issue with latest Node

@t3chguy t3chguy closed this as completed Oct 13, 2023
@TomCool-TomTom
Copy link

t3chguy What version of Node are your referring to?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Developer-Experience O-Occasional Affects or can be seen by some users regularly or most users rarely S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect
Projects
None yet
Development

No branches or pull requests

8 participants