httptoolkit / httptoolkit-ui

The UI of HTTP Toolkit
https://httptoolkit.com
GNU Affero General Public License v3.0
282 stars 106 forks source link

Local build is broken #76

Closed rumpeltux closed 1 year ago

rumpeltux commented 1 year ago

On a fresh checkout I get a lot of deprecation and vulnerability warnings and startup fails.

Unfortunately I don’t have sufficient node experience to fix this myself, looks like a lot of things are outdated / broken, most notably probably the codebase needs to be updated for a more recent webpack version.

$ npm install
npm WARN deprecated @types/classnames@2.3.1: This is a stub types definition. classnames provides its own type definitions, so you do not need this installed.
npm WARN deprecated mkdirp-promise@1.1.0: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.
npm WARN deprecated gulp-header@1.8.12: Removed event-stream from gulp-header
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/pinpoint@1.0.2: Moved to 'npm install @sideway/pinpoint'
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated har-validator@5.1.3: this library is no longer supported
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated circular-json@0.5.9: CircularJSON is in maintenance only, flatted is its successor.
npm WARN deprecated @hapi/formula@1.2.0: Moved to 'npm install @sideway/formula'
npm WARN deprecated formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated html-webpack-plugin@3.2.0: 3.x is no longer supported
npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
npm WARN deprecated uuid@3.3.2: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated vscode-emmet-helper@1.2.11: This package has been renamed to @vscode/emmet-helper, please update to the new name
npm WARN deprecated axios@0.19.2: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm WARN deprecated @hapi/joi@16.1.8: Switch to 'npm install joi'
npm WARN deprecated superagent@5.3.1: Please upgrade to v7.0.2+ of superagent.  We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing.  See the releases tab for more information at <https://github.com/visionmedia/superagent/releases>. Thanks to @shadowgate15, @spence-s, and @niftylettuce. Superagent is sponsored by Forward Email at <https://forwardemail.net>.
npm WARN deprecated core-js@1.2.7: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated core-js@2.6.12: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.

added 1874 packages, and audited 1933 packages in 3m

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

65 vulnerabilities (3 low, 22 moderate, 28 high, 12 critical)

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

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

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
$ npm run start:web

> httptoolkit-ui@0.1.0 start:web
> env-cmd -f ./automation/ts-node.env webpack-dev-server --config ./automation/webpack.dev.ts

ℹ 「wds」: Project is running at http://local.httptoolkit.tech:8080/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /tmp/httpui/dist
ℹ 「wds」: 404s will fallback to /index.html
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 (/tmp/httpui/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/tmp/httpui/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/tmp/httpui/node_modules/webpack/lib/NormalModule.js:471:10)
    at /tmp/httpui/node_modules/webpack/lib/NormalModule.js:503:5
    at /tmp/httpui/node_modules/webpack/lib/NormalModule.js:358:12
    at /tmp/httpui/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/tmp/httpui/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/tmp/httpui/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at /tmp/httpui/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at runSyncOrAsync (/tmp/httpui/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
    at iterateNormalLoaders (/tmp/httpui/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
    at Array.<anonymous> (/tmp/httpui/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/tmp/httpui/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /tmp/httpui/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
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 (/tmp/httpui/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/tmp/httpui/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/tmp/httpui/node_modules/webpack/lib/NormalModule.js:471:10)
    at /tmp/httpui/node_modules/webpack/lib/NormalModule.js:503:5
    at /tmp/httpui/node_modules/webpack/lib/NormalModule.js:358:12
    at /tmp/httpui/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/tmp/httpui/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at Array.<anonymous> (/tmp/httpui/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/tmp/httpui/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /tmp/httpui/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
    at /tmp/httpui/node_modules/graceful-fs/graceful-fs.js:123:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3)
ode:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

RpcIpcMessagePortClosedError: Cannot send the message - the message port has been closed for the process 1291964.
    at /tmp/httpui/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:47:47
    at process.processTicksAndRejections (node:internal/process/task_queues:81:21) {
  code: undefined,
  signal: undefined
}
pimterry commented 1 year ago

Hi @rumpeltux. For the install, none of those warnings really matter: they're largely suggested updates or warnings about future maintenance but the packages referenced work fine and that's fine. Updates welcome of course if you'd like to take a look, but I wouldn't worry about it.

The Error: error:0308010C:digital envelope routines::unsupported is a real problem of course. This will be because this project is indeed still using an older webpack, and you're running a new version of Node that dropped support for some APIs. If you install Node v16 everything will work correctly.

If you'd like to update Webpack, PRs would be very welcome there of course, but it's a big job and other than this the existing version still works perfectly well.

In general, when you run into issues like this, I'd recommend looking at projects' CI setups. This does build in CI with no problems, and you can see from there exactly which node version is being used and what the rest of the environment is etc etc.