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

Circuit compilation fail with wasm, if a dependency has no dependencies tag in Nargo.toml #4338

Closed
KumaCrypto opened this issue Feb 12, 2024 · 1 comment · Fixed by #4344
Closed
Assignees

Comments

@KumaCrypto
Copy link

Hey, I noticed a problem that during compilation if a library that is in a dependency for main project has no [dependencies] tag, then the Package.getDependencies function will return undefined which eventually causes the program to crash when trying Object.entries(noirPackage.getDependencies())) with the error Cannot convert undefined or null to object.

I found a simple workaround to just add an empty [dependencies] tag to Nargo.toml of the library, which by this point is already copied to the local environment. But that adds a headache : )

I think you should add a check for undefined before the for loop, and if it is, just skip to the next iteration of the while.

@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Feb 12, 2024
@TomAFrench TomAFrench self-assigned this Feb 12, 2024
github-merge-queue bot pushed a commit that referenced this issue Feb 12, 2024
# Description

## Problem\*



## Summary\*

While looking at #4338 I noticed that we weren't linting noir_wasm. This
PR adds `eslint` dependencies

## Additional Context



## Documentation\*

Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[Exceptional Case]** Documentation to be submitted in a separate
PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
@TomAFrench
Copy link
Member

TomAFrench commented Feb 12, 2024

Thanks for making us aware of this. I've added a check so that we return an empty dependencies map rather than undefined here in #4344

github-merge-queue bot pushed a commit that referenced this issue Feb 22, 2024
…4344)

# Description

## Problem\*

Resolves #4338

## Summary\*

This PR returns an empty dependencies map rather than undefined if the
package being compiled doesn't have any dependencies.

I've also updated the test suite so it also compiles more than just a
contract

## Additional Context



## Documentation\*

Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[Exceptional Case]** Documentation to be submitted in a separate
PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.

---------

Co-authored-by: kevaundray <kevtheappdev@gmail.com>
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants