-
Notifications
You must be signed in to change notification settings - Fork 23
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
Unable to run on Node.js 17.9.0/18.2.0 #168
Comments
This also has memory leakage as a side effect: To replicate: use Node v18.6, attempt to run workspaces-js tests for https://github.com/near-examples/FT |
I'm encountering a similar issue when trying to run integration tests from create-near-app.
Sample code that results in a kill Node 18: import anyTest, { TestFn } from 'ava';
import * as path from "path";
const test = anyTest as TestFn<{
worker: Worker;
accounts: Record<string, NearAccount>;
}>;
test( "create sub-account", async (t) => {
const worker = await Worker.init();
const root = worker.rootAccount;
// Hangs on this line w/ Node 18. Also hangs on deploy contract and others.
const contract = await root.createSubAccount("test-account");
t.context.worker = worker;
t.context.accounts = { root, contract };
}); |
This bug turns out to be due to an issue with node name resolution in Node18. I'll push a PR which addresses it. |
This issue is affecting at least the example repos referenced by https://docs.near.org/develop/quickstart-guide , whose integration tests uses workspaces-js
Exact line it's getting stuck is: For those who are new to node.js/ javascript/typescript, a temporary workaround is to downgrade node: First, install nvm
Then, downgrade node
Now, integration tests will run fine with downgraded node.
|
If you install node 17.9.0/18.2.0 (using
nvm
or through other means) and runyarn test
in theworkspaces-js
root directory all tests will fail with the following error:Rejected promise returned by test. Reason:
Error (TypedError)
{ context: undefined, type: 'RetriesExceeded', message: 'Exceeded 10 attempts for http://localhost:1026.', }
› Object.fetchJson (node_modules/near-api-js/lib/utils/web.js:47:15)
› async node_modules/near-api-js/lib/providers/json-rpc-provider.js:312:34
› async Object.exponentialBackoff [as default] (node_modules/near-api-js/lib/utils/exponential-backoff.js:7:24)
› async JsonRpcProvider.sendJsonRpc (node_modules/near-api-js/lib/providers/json-rpc-provider.js:304:26)
› async JsonRpcProvider.query (node_modules/near-api-js/lib/providers/json-rpc-provider.js:116:22)
› async Account.findAccessKey (node_modules/near-api-js/lib/account.js:186:31)
› async Account.signTransaction (node_modules/near-api-js/lib/account.js:91:31)
› async node_modules/near-api-js/lib/account.js:118:34
› async Object.exponentialBackoff [as default] (node_modules/near-api-js/lib/utils/exponential-backoff.js:7:24)
› async Account.signAndSendTransactionV2 (node_modules/near-api-js/lib/account.js:117:24)
The last Node.js that works for me is 16.15.0
The text was updated successfully, but these errors were encountered: