Skip to content

Develop does not build without lock-file #778

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

Closed
ghost opened this issue Sep 6, 2024 · 3 comments · Fixed by #794
Closed

Develop does not build without lock-file #778

ghost opened this issue Sep 6, 2024 · 3 comments · Fixed by #794
Labels

Comments

@ghost
Copy link

ghost commented Sep 6, 2024

Description

When building a library as a dependency the lock file in this repo is not honored. This is expected behavior. Unfortunately with the current versions specified in the package.json this library will not build. Even though your CI builds since it is using the lock file. FYI libraries should not commit their lock file for this exact reason. yarnpkg/yarn#838 (comment)

Build Error

Below is the build error

src/urdf/UrdfModel.js:35:7 - error TS2322: Type 'Element | null' is not assignable to type 'Element | undefined'.
  Type 'null' is not assignable to type 'Element | undefined'.

35       xmlDoc = parser.parseFromString(string, MIME_TYPE.XML_TEXT).documentElement;
         ~~~~~~


Found 1 error in src/urdf/UrdfModel.js:35

Lock File Diff

Below is the diff between the committed lock file and one generated fresh.
├ @xmldom/[email protected] -> @xmldom/[email protected]
├ @testing-library/[email protected] -> @testing-library/[email protected]
│ └ @babel/[email protected] -> @babel/[email protected]
├ @types/[email protected] -> @types/[email protected]
│ └ [email protected] -> [email protected]
├ @types/[email protected] -> @types/[email protected][email protected] -> [email protected]
│ ├ @eslint/[email protected] -> @eslint/[email protected]
│ │ └ [email protected] -> [email protected]
│ │   └ [email protected] -> [email protected]
│ ├ @eslint/[email protected] -> @eslint/[email protected]
│ ├ [email protected] -> [email protected]
│ ├ [email protected] -> [email protected]
│ ├ [email protected] -> [email protected]
│ │ ├ - @aashutoshrathi/[email protected]
│ │ └ + [email protected]
│ ├ [email protected] -> [email protected]
│ └ [email protected] -> [email protected][email protected] -> [email protected]
│ ├ @babel/[email protected] -> @babel/[email protected]
│ │ └ + @babel/[email protected]
│ │   ├ + @babel/[email protected]
│ │   ├ + @babel/[email protected]
│ │   └ + [email protected]
│ ├ @jsdoc/[email protected] -> @jsdoc/[email protected]
│ ├ @types/[email protected] -> @types/[email protected]
│ │ ├ @types/[email protected] -> @types/[email protected]
│ │ └ @types/[email protected] -> @types/[email protected]
│ ├ [email protected] -> [email protected]
│ │ ├ [email protected] -> [email protected]
│ │ ├ [email protected] -> [email protected]
│ │ │ └ [email protected] -> [email protected]
│ │ ├ [email protected] -> [email protected]
│ │ └ + [email protected]
│ └ [email protected] -> [email protected][email protected] -> [email protected][email protected] -> [email protected]
│ ├ [email protected] -> [email protected]
│ │ └ [email protected] -> [email protected]
│ └ [email protected] -> [email protected][email protected] -> [email protected]
│ ├ @vitest/[email protected] -> @vitest/[email protected]
│ │ ├ @vitest/[email protected] -> @vitest/[email protected]
│ │ └ @vitest/[email protected] -> @vitest/[email protected]
│ │   └ @vitest/[email protected] -> @vitest/[email protected]
│ ├ @vitest/[email protected] -> @vitest/[email protected]
│ ├ @vitest/[email protected] -> @vitest/[email protected]
│ ├ [email protected] -> [email protected]
│ ├ [email protected] -> [email protected]
│ ├ [email protected] -> [email protected]
│ ├ [email protected] -> [email protected]
│ └ [email protected] -> [email protected]
├ @babel/[email protected] -> @babel/[email protected]
│ ├ @babel/[email protected] -> @babel/[email protected]
│ │ ├ @babel/[email protected] -> @babel/[email protected]
│ │ └ + [email protected]
│ ├ - [email protected]
│ │ ├ - [email protected]
│ │ │ └ - [email protected]
│ │ │   └ - [email protected]
│ │ ├ - [email protected]
│ │ └ - [email protected]
│ │   └ - [email protected][email protected] -> [email protected][email protected] -> [email protected]
├ @volar/[email protected] -> @volar/[email protected]
│ └ @volar/[email protected] -> @volar/[email protected]
│   └ @volar/[email protected] -> @volar/[email protected][email protected] -> [email protected][email protected] -> [email protected][email protected] -> [email protected][email protected] -> [email protected]
│ └ - [email protected]
│   └ - [email protected]
├ @volar/[email protected] -> @volar/[email protected]
│ └ @volar/[email protected] -> @volar/[email protected]
├ @vue/[email protected] -> @vue/[email protected]
│ ├ @vue/[email protected] -> @vue/[email protected]
│ │ └ @vue/[email protected] -> @vue/[email protected][email protected] -> [email protected]
├ @volar/[email protected] -> @volar/[email protected][email protected] -> [email protected][email protected] -> [email protected][email protected] -> [email protected]
  ├ - [email protected]
  └ + [email protected]
    └ + [email protected]

Solution

Ideally the package.json should be updated to reflect the required versions of dependencies.

@ghost ghost added the bug label Sep 6, 2024
@MatthijsBurgh
Copy link
Contributor

I don't think some minor/patch version updates do break the build. This should not be the case. So please figure out what package version requirement is incorrect.

The line of code which is causing you issues was updated in combination of a minor version bump of @xmldom/xmldom. So unless one of the bugfixes in the patch version upgrades are needed, That one can't be the issue. But other packages shouldn't be relevant.

So please do some research on which package is the issue for you.

@ghost
Copy link
Author

ghost commented Sep 16, 2024

Have you tried building without the lock file? Remove the node modules folder and run npm install --package-lock false

For now we are sticking with 6284a5f till this is fixed.

@MatthijsBurgh
Copy link
Contributor

Removing the lock file and running npm install fails indeed.

I am not sure it it is a bad practice to build with a lock file. But lets skip that point here.

When checking the new generate lock file in combination with the build errors, you could also have noticed a patch bump of @xmldom/xmldom. Something I mentioned. But you didn't put any effort in to look at. I am willing to help. But this is open-source software. So some effort from your side is also required.

The error shown is introduced in 0.9.2. (0.9.1 is also broken, but for another reason.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant