neherlab / covid19_scenarios

Models of COVID-19 outbreak trajectories and hospital demand
https://covid19-scenarios.org
MIT License
1.36k stars 354 forks source link

fix: fix crash when running snyk protect #676

Closed ivan-aksamentov closed 4 years ago

ivan-aksamentov commented 4 years ago

Related issues and PRs

snyk protect command was crashig with:

$ yarn snyk-protect
yarn run v1.22.4
$ snyk protect
Error: Cannot find module 'core-js/library/fn/set-immediate'
Require stack:
- node_modules/snyk-nuget-plugin/node_modules/jszip/lib/utils.js
- node_modules/snyk-nuget-plugin/node_modules/jszip/lib/utf8.js
- node_modules/snyk-nuget-plugin/node_modules/jszip/lib/object.js
- node_modules/snyk-nuget-plugin/node_modules/jszip/lib/index.js
- node_modules/snyk-nuget-plugin/dist/nuget-parser/nuspec-parser.js
- node_modules/snyk-nuget-plugin/dist/nuget-parser/dotnet-framework-parser.js
- node_modules/snyk-nuget-plugin/dist/nuget-parser/index.js
- node_modules/snyk-nuget-plugin/dist/index.js
- node_modules/snyk/dist/lib/plugins/index.js
- node_modules/snyk/dist/lib/plugins/get-single-plugin-result.js
- node_modules/snyk/dist/lib/plugins/get-multi-plugin-result.js
- node_modules/snyk/dist/lib/plugins/get-deps-from-plugin.js
- node_modules/snyk/dist/lib/snyk-test/run-test.js
- node_modules/snyk/dist/lib/snyk-test/index.js
- node_modules/snyk/dist/lib/index.js
- node_modules/snyk/dist/lib/analytics.js
- node_modules/snyk/dist/cli/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1020:15)
    at Function.Module._load (internal/modules/cjs/loader.js:890:27)
    at Module.require (internal/modules/cjs/loader.js:1080:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (node_modules/snyk-nuget-plugin/node_modules/jszip/lib/utils.js:6:20)
    at Module._compile (internal/modules/cjs/loader.js:1176:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)
    at Module.load (internal/modules/cjs/loader.js:1040:32)
    at Function.Module._load (internal/modules/cjs/loader.js:929:14)
    at Module.require (internal/modules/cjs/loader.js:1080:19)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Description

The crash was due to mismatch in core-js version: snyk relies on core-js@2 via jszip and snyk-nuget-plugin (why do we even have the C# plugin here?), while we forcefully resolve core-js to version 3 using yarn resolutions.

Happily the dependency on core-js was dropped in jszip@3.4.0, so we resolve jszip to 3.4.0 now. This fixes the crash.

Impacted Areas in the application

Testing

vercel[bot] commented 4 years ago

This pull request is being automatically deployed with Vercel (learn more). To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/covid19-scenarios/covid19-scenarios/137qjspqz ✅ Preview: https://covid19-scenarios-git-fix-snyk-crash.covid19-scenarios.now.sh

codeclimate[bot] commented 4 years ago

Code Climate has analyzed commit eb0c1aa3 and detected 0 issues on this pull request.

View more on Code Climate.