-
Notifications
You must be signed in to change notification settings - Fork 270
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
CLI beta38 errors with "Unexpected token 'export'" when installed via npm #1597
Comments
This is caused by This is also the reason why it works with yarn and not with npm: yarn does not install peer dependencies by default, so the version of source-resolver that gets installed is 1.1.1 as required by our noir-compiler. On the other hand, npm install 1.1.1 locally for the noir-compiler package, but also installs 1.1.2 in the project root to be used by noir_wasm. This means the issue can be sidestepped by manually installing 1.1.1 of the resolver along with the CLI, like:
It seems that noir-resolver recently got a fix by @ludamad which may solve this issue. We're waiting on a release of that package to update and see if it fixes things. |
Issue #1597 was preventing users from installing the Aztec CLI via npm. Releasing a new version of `noir_wasm` and `noir-source-resolver` didn't fix the issue unfortunately, and further tweaking `noir-source-resolver` so it's loaded properly leads to errors due since [the resolver is a global object](https://nodejs.org/api/packages.html#approach-2-isolate-state) but it's treated as different objects when loaded as commonjs or esm. So the noir-compiler here is properly configuring the resolver in esm-land, but noir_wasm loads it via commonjs and fails. To make things worse, jest seems to be complaining about misconfigured esm modules here. Given that noir_wasm is not kept up-to-date atm and is not the recommended way to compile noir contracts, I decided to time out and remove it altogether for now. I'm creating a new issue to revisit this in the future. Fixes #1597
Issue AztecProtocol/aztec-packages#1597 was preventing users from installing the Aztec CLI via npm. Releasing a new version of `noir_wasm` and `noir-source-resolver` didn't fix the issue unfortunately, and further tweaking `noir-source-resolver` so it's loaded properly leads to errors due since [the resolver is a global object](https://nodejs.org/api/packages.html#approach-2-isolate-state) but it's treated as different objects when loaded as commonjs or esm. So the noir-compiler here is properly configuring the resolver in esm-land, but noir_wasm loads it via commonjs and fails. To make things worse, jest seems to be complaining about misconfigured esm modules here. Given that noir_wasm is not kept up-to-date atm and is not the recommended way to compile noir contracts, I decided to time out and remove it altogether for now. I'm creating a new issue to revisit this in the future. Fixes AztecProtocol/aztec-packages#1597
When installing the CLI with npm, any command fails with:
(thanks @critesjosh for the report)
The text was updated successfully, but these errors were encountered: