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

build: google-protobuf > v3.19 does not work in NodeJS environment #143

Closed
peterpeterparker opened this issue Jul 12, 2022 · 0 comments · Fixed by #162
Closed

build: google-protobuf > v3.19 does not work in NodeJS environment #143

peterpeterparker opened this issue Jul 12, 2022 · 0 comments · Fixed by #162

Comments

@peterpeterparker
Copy link
Member

Issue

google-protobuf > v3.19 does not work in NodeJS environment. Per extension the lib makes non-window / nodejs jest tests of nns-dapp fail

This is tracked at in protobuf-javascript repo issue #8

Stacktrace example

FAIL src/tests/lib/api/canisters.api.spec.ts
● Test suite failed to run

The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/configuration#testenvironment-string.
Consider using the "jsdom" test environment.

ReferenceError: window is not defined

peterpeterparker added a commit that referenced this issue Jul 12, 2022
# Motivation

Workaround: downgrade google-protobuf to make nns-js lib works in NodeJs environment too.

Related to #143
peterpeterparker added a commit that referenced this issue Aug 2, 2022
# Motivation

Resolve #143.

This will also fix the usage of the lib for testing purpose as it referenced a version of `google-protobuf` that fails with `jest` in a NodeJS context - e.g. when running tests in NNS-dapp.

# Changes

- bump `google-protobuf` last version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant