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

Docker fails with TSError: ⨯ Unable to compile TypeScript: #20

Closed
pcaversaccio opened this issue May 2, 2024 · 5 comments
Closed

Comments

@pcaversaccio
Copy link

I just tried your latest version (commit 2605e17) and I face the following issue when I run ./start.sh:

$ node build/index.js f yarn --cwd /infrastructure/local-setup-preparation start
$ ts-node ./src/index.ts
                    zksync-1    | /infrastructure/local-setup-preparation/node_modules/ts-node/src/index.ts:859
                    zksync-1    |     return new TSError(diagnosticText, diagnosticCodes, diagnostics);
                    zksync-1    |            ^
                    zksync-1    | TSError: ⨯ Unable to compile TypeScript:
                    zksync-1    | src/index.ts:14:10 - error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
                    zksync-1    | 
                    zksync-1    | 14     if (!process.env.CONTRACTS_DIAMOND_PROXY_ADDR) {
                    zksync-1    |             ~~~~~~~
                    zksync-1    | src/index.ts:22:42 - error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
                    zksync-1    | 
                    zksync-1    | 22     const contract = new ethers.Contract(process.env.CONTRACTS_DIAMOND_PROXY_ADDR, utils.ZKSYNC_MAIN_ABI, ethProvider);
                    zksync-1    |                                             ~~~~~~~
                    zksync-1    | src/index.ts:31:46 - error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
                    zksync-1    | 
                    zksync-1    | 31         const contract = new ethers.Contract(process.env.CONTRACTS_DIAMOND_PROXY_ADDR, utils.ZKSYNC_MAIN_ABI, wallet);
                    zksync-1    |                                                 ~~~~~~~
                    zksync-1    | 
                    zksync-1    |     at createTSError (/infrastructure/local-setup-preparation/node_modules/ts-node/src/index.ts:859:12)
                    zksync-1    |     at reportTSError (/infrastructure/local-setup-preparation/node_modules/ts-node/src/index.ts:863:19)
                    zksync-1    |     at getOutput (/infrastructure/local-setup-preparation/node_modules/ts-node/src/index.ts:1077:36)
                    zksync-1    |     at Object.compile (/infrastructure/local-setup-preparation/node_modules/ts-node/src/index.ts:1433:41)
                    zksync-1    |     at Module.m._compile (/infrastructure/local-setup-preparation/node_modules/ts-node/src/index.ts:1617:30)
                    zksync-1    |     at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
                    zksync-1    |     at Object.require.extensions.<computed> [as .ts] (/infrastructure/local-setup-preparation/node_modules/ts-node/src/index.ts:1621:12)
                    zksync-1    |     at Module.load (node:internal/modules/cjs/loader:1119:32)
                    zksync-1    |     at Function.Module._load (node:internal/modules/cjs/loader:960:12)
                    zksync-1    |     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
                    zksync-1    |   diagnosticCodes: [ 2580, 2580, 2580 ]
                    zksync-1    | }
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
zksync-1 exited with code 1
@benceharomi
Copy link
Contributor

Do you use the latest local-node docker image?

Please make sure that the used images are the following:

➜  ~ docker inspect --format='{{index .RepoDigests 0}}' matterlabs/local-node:latest2.0

matterlabs/local-node@sha256:7caf61fac152986915ff8d865a136f78b695a5ed3587883218fb2fd37fe67140
➜  ~ docker inspect --format='{{index .RepoDigests 0}}' postgres:14

postgres@sha256:d6850c40261fdc9a4fb33b9521d9d641c4a5dcb82145f7bcc32c9258f81e75a2
➜  ~ docker inspect --format='{{index .RepoDigests 0}}' ghcr.io/paradigmxyz/reth:v0.2.0-beta.2

ghcr.io/paradigmxyz/reth@sha256:ce7f45d7fd54245b51d8b17935da801d87978d8eabec1d3cda6abf0d133373f8

@pcaversaccio
Copy link
Author

Do you use the latest local-node docker image?

Please make sure that the used images are the following:

➜  ~ docker inspect --format='{{index .RepoDigests 0}}' matterlabs/local-node:latest2.0

matterlabs/local-node@sha256:7caf61fac152986915ff8d865a136f78b695a5ed3587883218fb2fd37fe67140
➜  ~ docker inspect --format='{{index .RepoDigests 0}}' postgres:14

postgres@sha256:d6850c40261fdc9a4fb33b9521d9d641c4a5dcb82145f7bcc32c9258f81e75a2
➜  ~ docker inspect --format='{{index .RepoDigests 0}}' ghcr.io/paradigmxyz/reth:v0.2.0-beta.2

ghcr.io/paradigmxyz/reth@sha256:ce7f45d7fd54245b51d8b17935da801d87978d8eabec1d3cda6abf0d133373f8

Ok that was indeed the issue, I was running an older docker image. I think now there is only one issue missing: it seems that the rich wallets https://github.com/matter-labs/local-setup/blob/main/rich-wallets.json are not really rich; I can't deploy anything using them... (https://github.com/pcaversaccio/zksync-vyper-sandbox/blob/main/deploy/deploy-zksync.ts#L24)

@benceharomi
Copy link
Contributor

benceharomi commented May 2, 2024

This PR will fix the rich-wallet issue, we will generate a new docker image for local-node once it's merged.

@pcaversaccio
Copy link
Author

This PR will fix the rich-wallet issue, we will generate a new docker image for local-node once it's merged.

Great - will wait for the merge and your update. Since the original issue got resolved, closing the issue. Thx!

@benceharomi
Copy link
Contributor

@pcaversaccio rich accounts are rich again: #19 (comment)

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

No branches or pull requests

2 participants