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

update dependencies where possible #148

Closed
karussell opened this issue Oct 29, 2021 · 7 comments · Fixed by #165
Closed

update dependencies where possible #148

karussell opened this issue Oct 29, 2021 · 7 comments · Fixed by #165
Milestone

Comments

@karussell
Copy link
Member

karussell commented Oct 29, 2021

(and maybe we should all upgrade to a more recent npm version to avoid these package-lock.json problems?)

@karussell karussell added this to the 0.3 milestone Oct 29, 2021
@easbar
Copy link
Member

easbar commented Nov 10, 2021

Another (maybe related) issue is that I cannot re-create the build. This:

rm -rf node_modules/ && rm -f package-lock.json && npm i && npm run serve

returns these errors:

npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported

> sharp@0.28.3 install /home/path/to/graphhopper-maps/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)

sharp: Using cached /home/me/.npm/_libvips/libvips-8.10.6-linux-x64.tar.br
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^2.1.2 (node_modules/jest-haste-map/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN awesome-typescript-loader@5.2.1 requires a peer of typescript@^2.7 || ^3 but none is installed. You must install peer dependencies yourself.
npm WARN graphhopper-maps-react@0.0.0 No repository field.
npm WARN graphhopper-maps-react@0.0.0 No license field.

added 1455 packages from 898 contributors in 24.537s

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


> graphhopper-maps-react@0.0.0 serve /home/path/to/graphhopper-maps
> webpack serve --config webpack.dev.js

ℹ 「wds」: Project is running at http://0.0.0.0:3000/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /home/path/to/graphhopper-maps/dist
ℹ 「atl」: Using typescript@4.4.4 from typescript
ℹ 「atl」: Using tsconfig.json from /home/path/to/graphhopper-maps/tsconfig.json
✖ 「atl」: Child process failed to process the request: Error: Debug Failure. False expression.
    at resolveNamesWithLocalCache (/home/path/to/graphhopper-maps/node_modules/typescript/lib/typescript.js:116384:26)
    at Object.resolveModuleNames (/home/path/to/graphhopper-maps/node_modules/typescript/lib/typescript.js:116427:20)
    at Object.resolveModuleNames (/home/path/to/graphhopper-maps/node_modules/typescript/lib/typescript.js:118165:112)
    at actualResolveModuleNamesWorker (/home/path/to/graphhopper-maps/node_modules/typescript/lib/typescript.js:111711:133)
    at resolveModuleNamesWorker (/home/path/to/graphhopper-maps/node_modules/typescript/lib/typescript.js:111977:26)
    at resolveModuleNamesReusingOldState (/home/path/to/graphhopper-maps/node_modules/typescript/lib/typescript.js:112074:24)
    at processImportedModules (/home/path/to/graphhopper-maps/node_modules/typescript/lib/typescript.js:113532:35)
    at findSourceFileWorker (/home/path/to/graphhopper-maps/node_modules/typescript/lib/typescript.js:113333:17)
    at findSourceFile (/home/path/to/graphhopper-maps/node_modules/typescript/lib/typescript.js:113194:26)
    at processImportedModules (/home/path/to/graphhopper-maps/node_modules/typescript/lib/typescript.js:113568:25)
✖ 「atl」: Child process failed to process the request: TypeError: Cannot read property 'updateRootFileNames' of undefined
    at getProgram (/home/path/to/graphhopper-maps/node_modules/awesome-typescript-loader/src/checker/runtime.ts:152:10)
    at getEmitOutput (/home/path/to/graphhopper-maps/node_modules/awesome-typescript-loader/src/checker/runtime.ts:403:19)
    at emit (/home/path/to/graphhopper-maps/node_modules/awesome-typescript-loader/src/checker/runtime.ts:422:24)
    at processEmit (/home/path/to/graphhopper-maps/node_modules/awesome-typescript-loader/src/checker/runtime.ts:458:22)
    at /home/path/to/graphhopper-maps/node_modules/awesome-typescript-loader/src/checker/runtime.ts:610:6
    at Object.send (/home/path/to/graphhopper-maps/node_modules/awesome-typescript-loader/src/checker/runtime.ts:49:6)
    at Checker.req (/home/path/to/graphhopper-maps/node_modules/awesome-typescript-loader/src/checker/checker.ts:100:15)
    at Checker.emitFile (/home/path/to/graphhopper-maps/node_modules/awesome-typescript-loader/src/checker/checker.ts:105:15)
    at transform (/home/path/to/graphhopper-maps/node_modules/awesome-typescript-loader/src/index.ts:130:26)
    at transformationFunction (/home/path/to/graphhopper-maps/node_modules/awesome-typescript-loader/src/index.ts:72:40)
(node:2099840) UnhandledPromiseRejectionWarning: null
(Use `node --trace-warnings ...` to show where the warning was created)
(node:2099840) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:2099840) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
✖ 「atl」: Child process failed to process the request: TypeError: Cannot read property 'getProgram' of undefined
    at getProgram (/home/path/to/graphhopper-maps/node_modules/awesome-typescript-loader/src/checker/runtime.ts:154:16)
    at processFiles (/home/path/to/graphhopper-maps/node_modules/awesome-typescript-loader/src/checker/runtime.ts:468:11)
    at /home/path/to/graphhopper-maps/node_modules/awesome-typescript-loader/src/checker/runtime.ts:616:6
    at Object.send (/home/path/to/graphhopper-maps/node_modules/awesome-typescript-loader/src/checker/runtime.ts:49:6)
    at Checker.req (/home/path/to/graphhopper-maps/node_modules/awesome-typescript-loader/src/checker/checker.ts:100:15)
    at Checker.getFiles (/home/path/to/graphhopper-maps/node_modules/awesome-typescript-loader/src/checker/checker.ts:141:15)
    at /home/path/to/graphhopper-maps/node_modules/awesome-typescript-loader/src/instance.ts:483:34
    at _next0 (eval at create (/home/path/to/graphhopper-maps/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:8:1)
    at eval (eval at create (/home/path/to/graphhopper-maps/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:23:1)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
✖ 「wdm」: asset bundle.js 353 KiB [emitted] (name: main) 1 related asset
asset assets/favicon.png 16.2 KiB [emitted]
asset index.html 786 bytes [emitted]
runtime modules 432 bytes 3 modules
cacheable modules 337 KiB
  modules by path ./node_modules/webpack-dev-server/client/ 20.9 KiB 10 modules
  modules by path ./node_modules/html-entities/lib/*.js 61 KiB 5 modules
  modules by path ./node_modules/url/ 37.4 KiB 3 modules
  modules by path ./node_modules/querystring/*.js 4.51 KiB
    ./node_modules/querystring/index.js 127 bytes [built] [code generated]
    ./node_modules/querystring/decode.js 2.34 KiB [built] [code generated]
    ./node_modules/querystring/encode.js 2.04 KiB [built] [code generated]
  modules by path ./node_modules/webpack/hot/ 1.42 KiB
    ./node_modules/webpack/hot/emitter.js 75 bytes [built] [code generated]
    ./node_modules/webpack/hot/log.js 1.34 KiB [built] [code generated]
./node_modules/webpack/hot/ sync nonrecursive ^\.\/log$ 170 bytes [built] [code generated]

LOG from favicons-webpack-plugin
<i> generate only a single favicon for fast compilation time in development mode. This behaviour can be changed by setting the favicon mode option.

ERROR in ./src/index.tsx
Module build failed: Error: Final loader (./node_modules/awesome-typescript-loader/dist/entry.js) didn't return a Buffer or String
    at processResult (/home/path/to/graphhopper-maps/node_modules/webpack/lib/NormalModule.js:767:17)
    at /home/path/to/graphhopper-maps/node_modules/webpack/lib/NormalModule.js:853:5
    at /home/path/to/graphhopper-maps/node_modules/loader-runner/lib/LoaderRunner.js:406:3
    at iterateNormalLoaders (/home/path/to/graphhopper-maps/node_modules/loader-runner/lib/LoaderRunner.js:232:10)
    at iterateNormalLoaders (/home/path/to/graphhopper-maps/node_modules/loader-runner/lib/LoaderRunner.js:239:10)
    at /home/path/to/graphhopper-maps/node_modules/loader-runner/lib/LoaderRunner.js:254:3
    at context.callback (/home/path/to/graphhopper-maps/node_modules/loader-runner/lib/LoaderRunner.js:124:13)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

webpack 5.63.0 compiled with 1 error in 1312 ms
ℹ 「wdm」: Failed to compile.

This was using the fermium LTS node release (node=14.18.1, npm=6.14.15)

Using the latest LTS (gallium, node=16.13.0, npm=8.1.0) it does not work either

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: graphhopper-maps-react@0.0.0
npm ERR! Found: typescript@4.4.4
npm ERR! node_modules/typescript
npm ERR!   dev typescript@"^4.1.5" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer typescript@"^2.7 || ^3" from awesome-typescript-loader@5.2.1
npm ERR! node_modules/awesome-typescript-loader
npm ERR!   dev awesome-typescript-loader@"^5.2.1" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /home/me/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/me/.npm/_logs/2021-11-10T11_08_39_369Z-debug.log

It seems like only the exact versions in package-lock.json work, but if we had to re-create it we would end up with the above error.

@easbar
Copy link
Member

easbar commented Nov 10, 2021

and maybe we should all upgrade to a more recent npm version to avoid these package-lock.json problems?)

I think we should use one of the LTS versions. And since the only one that is not in maintenance mode currently is gallium maybe we should just use this. https://nodejs.org/en/about/releases/ Unfortunately, currently it does not work :)

@easbar
Copy link
Member

easbar commented Nov 10, 2021

@Janekdererste I suspect awesome-typescript-loader to cause some of the issues I ran into (see above). It has not been updated for three years. Do you think we still need this? https://www.npmjs.com/package/awesome-typescript-loader

@easbar
Copy link
Member

easbar commented Nov 10, 2021

The annoying thing here is that we can only upgrade the dependencies in a meaningful way if we remove package-lock.json, but as soon as we do this the build fails even without any changes in package.json.

@easbar
Copy link
Member

easbar commented Nov 10, 2021

Also I think we should pin the versions of our dependencies in package.json. We have the lock file anyway, so not pinning the versions in package.json makes no sense??!

@easbar
Copy link
Member

easbar commented Nov 10, 2021

Btw if you are trying to update dependencies keep in mind that npm update does not update npm/cli#708

The JS eco-system is just a comedy :D

@easbar
Copy link
Member

easbar commented Nov 10, 2021

npm outdated is quite useful. Running this against #158 I get:

Package             Current  Wanted        Latest  Location                         Depended by
css-loader            5.2.7   5.2.7         6.5.1  node_modules/css-loader          gh-maps-react
jest                 26.6.3  26.6.3        27.3.1  node_modules/jest                gh-maps-react
prettier              2.2.1   2.2.1         2.4.1  node_modules/prettier            gh-maps-react
react-map-gl         5.3.17  5.3.17        6.1.17  node_modules/react-map-gl        gh-maps-react
react-responsive      8.2.0   8.2.0  9.0.0-beta.4  node_modules/react-responsive    gh-maps-react
source-map-loader     2.0.2   2.0.2         3.0.0  node_modules/source-map-loader   gh-maps-react
style-loader          2.0.0   2.0.0         3.3.1  node_modules/style-loader        gh-maps-react
ts-jest              26.5.6  26.5.6        27.0.7  node_modules/ts-jest             gh-maps-react
webpack-dev-server   3.11.3  3.11.3         4.4.0  node_modules/webpack-dev-server  gh-maps-react

Note that we cannot update react-map-gl to v6, because the v6 branch is meant to use Mapbox 2.0, which has a commercial license (compared to the v5 branch which is meant for Mapbox 1.x).

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 a pull request may close this issue.

2 participants