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

Tests failing following semver 7.5.0 update #2077

Closed
Steve-Mcl opened this issue May 3, 2023 · 5 comments · Fixed by #2078
Closed

Tests failing following semver 7.5.0 update #2077

Steve-Mcl opened this issue May 3, 2023 · 5 comments · Fixed by #2078
Labels

Comments

@Steve-Mcl
Copy link
Contributor

Steve-Mcl commented May 3, 2023

Current Behavior

We currently use semver on vue pages and since it was updated to v7.5.0 tests fail with the error:

Module not found: Error: Can't resolve 'util' in '/home/runner/work/flowforge/flowforge/node_modules/semver/classes'

see this failed run for more detail.


Our current dependency of semver is ^7.3.8 meaning GH will use V7.x and thus hit this issue

Possible workarounds include: (from best/hardest to worst/easiest)

  • drop / replace webpack (something I believe @Pezmc is aiming for?)
  • add a fallback in webpack.config.js
  • replace semver with a browser ready module
  • browserfy semver
  • lock semver to pre v7.5.0 - done in Lock semver to minor changes #2078
    • until semver resolves this or makes a browser ready dist.

NOTE:

Anyone installing FF fresh will probably also hit this issue

Expected Behavior

tests to run without this error

Steps To Reproduce

raise a new PR that causes frontend tests to run

Environment

  • FlowForge version: 1.6.x-git

Have you provided an initial effort estimate for this issue?

I have provided an initial effort estimate

@Steve-Mcl Steve-Mcl added the needs-triage Needs looking at to decide what to do label May 3, 2023
@Steve-Mcl Steve-Mcl linked a pull request May 3, 2023 that will close this issue
11 tasks
@Steve-Mcl Steve-Mcl added upstream and removed needs-triage Needs looking at to decide what to do labels May 3, 2023
@Steve-Mcl
Copy link
Contributor Author

re-opening as the PR #2078 locking semver to version pre 7.5.0 is a temporary fix.

A permanent fix as described in the OP is preferred.

@Steve-Mcl Steve-Mcl reopened this May 3, 2023
@knolleary
Copy link
Member

Given we only use semver in one place in the frontend (introduced by #2042) another option is to just add the couple lines of code needed to do the required version check rather than import a whole module (whether semver or another) to do it.

This issue should not be the driving factor for replacing webpack - that's a bigger piece of work.

@Steve-Mcl
Copy link
Contributor Author

Steve-Mcl commented May 4, 2023

Alternatively, a possible contender: https://www.npmjs.com/package/compare-versions

This NPM lib has a healthy weekly download, is half the size of semver, is browser ready and has no deps.

@Pezmc
Copy link
Contributor

Pezmc commented May 10, 2023

@joepavitt
Copy link
Contributor

Closed by Update semver to avoid CVE #2718

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Closed / Done
Development

Successfully merging a pull request may close this issue.

4 participants