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

Dynamic import can only be transformed when transforming ES modules to AMD, CommonJS or SystemJS. node:internal/crypto/hash:69 #310

Open
SeamusMullan opened this issue Aug 16, 2023 · 2 comments

Comments

@SeamusMullan
Copy link

I got this issue after running npm start on a new react-juce project. unsure what has happened but below is a full copypasta of what was done.

(base) PS B:\DirektDSP\react-juce\packages\react-juce> npm run init -- "C:\Users\seamu\OneDrive\Direkt Software\FXBox\Source\jsui"

> [email protected] init
> node scripts/init.js C:\Users\seamu\OneDrive\Direkt Software\FXBox\Source\jsui

Initializing a React-JUCE template in: C:\Users\seamu\OneDrive\Direkt Software\FXBox\Source\jsui
Directory tree will be created if it does not exist.
[*] Copying template files
[*] Installing dependencies


Success! Initialized a React-JUCE template in C:\Users\seamu\OneDrive\Direkt Software\FXBox\Source\jsui

You can now get started by typing:

cd C:\Users\seamu\OneDrive\Direkt Software\FXBox\Source\jsui
npm start

Then adding the reactjuce::ReactApplicationRoot component to your project.

(base) PS B:\DirektDSP\react-juce\packages\react-juce> cd "C:\Users\seamu\OneDrive\Direkt Software\FXBox\Source\jsui"
(base) PS C:\Users\seamu\OneDrive\Direkt Software\FXBox\Source\jsui> npm start

> [email protected] start
> webpack -w --mode=development


webpack is watching the files…

Dynamic import can only be transformed when transforming ES modules to AMD, CommonJS or SystemJS.
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 module.exports (C:\Users\seamu\OneDrive\Direkt Software\FXBox\Source\jsui\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (C:\Users\seamu\OneDrive\Direkt Software\FXBox\Source\jsui\node_modules\webpack\lib\NormalModule.js:417:16)
    at handleParseError (C:\Users\seamu\OneDrive\Direkt Software\FXBox\Source\jsui\node_modules\webpack\lib\NormalModule.js:471:10)
    at C:\Users\seamu\OneDrive\Direkt Software\FXBox\Source\jsui\node_modules\webpack\lib\NormalModule.js:503:5
    at C:\Users\seamu\OneDrive\Direkt Software\FXBox\Source\jsui\node_modules\webpack\lib\NormalModule.js:358:12
    at C:\Users\seamu\OneDrive\Direkt Software\FXBox\Source\jsui\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (C:\Users\seamu\OneDrive\Direkt Software\FXBox\Source\jsui\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
    at iterateNormalLoaders (C:\Users\seamu\OneDrive\Direkt Software\FXBox\Source\jsui\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
    at C:\Users\seamu\OneDrive\Direkt Software\FXBox\Source\jsui\node_modules\loader-runner\lib\LoaderRunner.js:236:3
    at context.callback (C:\Users\seamu\OneDrive\Direkt Software\FXBox\Source\jsui\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
    at C:\Users\seamu\OneDrive\Direkt Software\FXBox\Source\jsui\node_modules\babel-loader\lib\index.js:44:71 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.17.0
@pedrononino
Copy link

I'm also having the same issue performing the same steps, we managed to fix it for the GainPlugin by

echo "export NODE_OPTIONS=--openssl-legacy-provider" > ~/.bash_profile

But for the template generator I get the same errors

@joao-gabriel-gois
Copy link

I'm also having the same issue performing the same steps, we managed to fix it for the GainPlugin by

echo "export NODE_OPTIONS=--openssl-legacy-provider" > ~/.bash_profile

But for the template generator I get the same errors

Be aware that:

  1. You need to source the profile file (either bash or for zsh, depending on the shell you're using).
  2. For me, once this option was added, I started to face problems to open VSCode from CLI, so I manually set NODE_OPTIONS="" before run vscode on CLI.

My point is that you might face some drawbacks for other node-based apps you might use and you can solve it by assigning an empty value to this variable in case it happens.

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

3 participants