Skip to content

Conversation

@gitname
Copy link

@gitname gitname commented Feb 8, 2023

Hi everyone, I think the JavaScript project has a bug related to filtering the categories. This PR contains a fix for it, plus a documentation update related to the project's Node version requirements.

1. Entering an invalid regular expression crashes the app

Here's a screencast showing the original behavior:

invalid-regex

Note: The character I typed into the textbox was a backslash (i.e. \).

I noticed the Python and Ruby projects each treat the query as a literal string instead of as a regular expression; so, in this PR, I updated the JavaScript project to do the same. That avoids the issue of whether the query is a valid regular expression or not.

Here's the new behavior:

string-compare

Footnote: In case the maintainers do want the app to interpret the query as a regular expression, I'd recommend wrapping the new RegExp(query, 'i') expression in a try/catch so the app doesn't crash when the query is an invalid regular expression.


2. $ yarn start fails when using Node v17+

The $ yarn start command runs OK when using Node v16, but not when using Node v17 or Node v18. When using Node v17 or Node v18, running $ yarn start results in the terminal displaying the following error:

$ yarn start

Starting the development server...

...

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 (C:\Temp\Code\reverb_code_extension\web_full_stack\js\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (C:\Temp\Code\reverb_code_extension\web_full_stack\js\node_modules\webpack\lib\NormalModule.js:417:16)
    at C:\Temp\Code\reverb_code_extension\web_full_stack\js\node_modules\webpack\lib\NormalModule.js:452:10
    at C:\Temp\Code\reverb_code_extension\web_full_stack\js\node_modules\webpack\lib\NormalModule.js:323:13
    at C:\Temp\Code\reverb_code_extension\web_full_stack\js\node_modules\loader-runner\lib\LoaderRunner.js:367:11
    at C:\Temp\Code\reverb_code_extension\web_full_stack\js\node_modules\loader-runner\lib\LoaderRunner.js:233:18
    at context.callback (C:\Temp\Code\reverb_code_extension\web_full_stack\js\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
    at C:\Temp\Code\reverb_code_extension\web_full_stack\js\node_modules\babel-loader\lib\index.js:55:103 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

I Googled the error code (i.e. ERR_OSSL_EVP_UNSUPPORTED) and found this comment on StackOverflow, which links to the Node v17 release notes, which mention that error code.

Now that I've read the release notes, I think the gist of the issue is that the JavaScript project is using an OpenSSL feature that is supported (by default) by the OpenSSL version included in Node v16, but is not supported (by default) by the OpenSSL version included in Node v17.

To address this discrepancy; in this PR, I updated the README.md to indicate that the latest compatible version of Node is v16. An alternative solution (which I did not implement) is to update the JavaScript project (either its own code or its dependency tree) so that it no longer relies on that OpenSSL feature.

Environment

  • OS: Windows 10 Enterprise LTSC 2019
  • Yarn version: 1.22.19
  • Node versions: v16.19.0 (runs OK), v17.9.1 (shows error), and v18.14.0 (shows error)

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

Successfully merging this pull request may close these issues.

1 participant