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

Bump dependencies to make it work on Node 20 #36

Merged
merged 2 commits into from
Jan 29, 2024

Conversation

robinst
Copy link
Contributor

@robinst robinst commented Jan 25, 2024

Motivation and modifications:

I started bumping dependencies because I initially got this error on yarn install:

...
    build_file_contents = open(build_file_path, "rU").read()
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid mode: 'rU' while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
...

This is caused by newer Python versions: nodejs/node-gyp#2219

So I bumped node-sass (which depends on gyp) to the newest version, along with yarn upgrade.

But bumping react-virtualized-auto-sizer resulted in this:

[tsl] ERROR in /Users/robinst/work/rsocket-chrome-devtools/src/viewer/App.tsx(494,12)
      TS2786: 'AutoSizer' cannot be used as a JSX component.
  Its instance type 'AutoSizer' is not a valid JSX element.
    The types returned by 'render()' are incompatible between these types.
      Type 'React.ReactNode' is not assignable to type 'import("/Users/robinst/work/rsocket-chrome-devtools/node_modules/@types/react-fontawesome/node_modules/@types/react/ts5.0/index").ReactNode'.
        Type '{}' is not assignable to type 'ReactNode'.

So I pinned that to the current version. I think the problem is that newer versions need a newer version of React, but that's a whole other can of worms.

The newer flexsearch version resulted in this:

Error in event handler: TypeError: flexsearch_1.Index is not a constructor

Also pinned that to the current version. Apparently it's a known problem: nextapps-de/flexsearch#341

Result:

Hopefully all the features still work. Please help test this :).

@@ -1,4 +1,4 @@
const merge = require("webpack-merge");
const { merge } = require("webpack-merge");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently this changed in newer versions, see:

[webpack-cli] TypeError: merge is not a function
    at Object.<anonymous> (/Users/robinst/work/rsocket-chrome-devtools/webpack.dev.js:4:18)

@robinst
Copy link
Contributor Author

robinst commented Jan 25, 2024

Don't merge this yet, running yarn dev works but yarn build errors like this:

ERROR in devtools.js from Terser
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:68:19)
    at Object.createHash (node:crypto:138:10)
    at /Users/robinst/work/rsocket-chrome-devtools/node_modules/terser-webpack-plugin/dist/index.js:217:37
    at Array.forEach (<anonymous>)
    at TerserPlugin.optimizeFn (/Users/robinst/work/rsocket-chrome-devtools/node_modules/terser-webpack-plugin/dist/index.js:160:259)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/robinst/work/rsocket-chrome-devtools/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:7:1)
    at AsyncSeriesHook.lazyCompileHook (/Users/robinst/work/rsocket-chrome-devtools/node_modules/tapable/lib/Hook.js:154:20)
    at /Users/robinst/work/rsocket-chrome-devtools/node_modules/webpack/lib/Compilation.js:1409:36
    at eval (eval at create (/Users/robinst/work/rsocket-chrome-devtools/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:12:1)
    at /Users/robinst/work/rsocket-chrome-devtools/node_modules/html-webpack-plugin/lib/cached-child-compiler.js:267:53

Might have to bump webpack too..

Without this, `yarn dev` worked but `yarn build` errored with

    ERROR in devtools.js from Terser
    Error: error:0308010C:digital envelope routines::unsupported
@robinst
Copy link
Contributor Author

robinst commented Jan 29, 2024

Might have to bump webpack too..

Done now, yarn build works too and a quick test showed things were working. But please do some testing with this as well as I don't know all the functionality.

Copy link
Member

@SerCeMan SerCeMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested the extension, and it's working as expected, thanks for the upgrade!

@SerCeMan SerCeMan merged commit 7dbbdc1 into rsocket:master Jan 29, 2024
@robinst robinst deleted the bump-dependencies branch January 30, 2024 05:24
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.

2 participants