Skip to content

Build errors in local environment #402

Description

@sifnoc

There are two errors on build in a local environment.

  1. Cannot find '../typechain' module at the first build in sometimes

    • Error log
       	...
       	@zkopru/contracts: No need to generate any newer typings.                                                              
       	@zkopru/client: ../contracts/src/zkopru.ts(30,8): error TS2307: Cannot find module '../typechain' or its corresponding type declarations.                                                                                                     
       	@zkopru/client: ../contracts/src/index.ts(2,15): error TS2307: Cannot find module '../typechain' or its corresponding type declarations.                                                                                                      
       	@zkopru/client: ../contracts/utils/deployer.ts(45,8): error TS2307: Cannot find module '../typechain' or its corresponding type declarations.                                                                                                 
       	@zkopru/client: error Command failed with exit code 2.                                                                                                                                                                                        
       	@zkopru/client: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.                                                                                                                                          
       	lerna ERR! yarn run build exited 2 in '@zkopru/client'                                                                                                                                                                                        
       	lerna ERR! yarn run build stdout:                                                                                                                                                                                                             
       	$ tsc --build tsconfig.build.json && webpack-cli                                                                                                                                                                                              
       	../contracts/src/zkopru.ts(30,8): error TS2307: Cannot find module '../typechain' or its corresponding type declarations.                                                                                                                     
       	../contracts/src/index.ts(2,15): error TS2307: Cannot find module '../typechain' or its corresponding type declarations.                                                                                                                      
       	../contracts/utils/deployer.ts(45,8): error TS2307: Cannot find module '../typechain' or its corresponding type declarations.                                                                                                                 
       	info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
       	...
      
    • Reproducing the error
      1. git clone https://github.com/zkopru-network/zkopru
      2. cd zkopru && yarn && yarn build
    • Temporal Solution,
      yarn build again, no more error message.
  2. Could not find some module when start cli app if not ran yarn build:fresh ever.

    • Error log

      LOG_LEVEL=trace node packages/cli/dist/apps/coordinator/cli.js --config packages/cli/coordinator.dev.json --daemon                        
      node:internal/modules/cjs/loader:936                                                                                   
        throw err;                                                                                                           
        ^                                                                                                                    
                                                                                                                             
      Error: Cannot find module '/home/jin/Projects/zkopru-network/kimi-review/zkopru/packages/cli/dist/apps/coordinator/cli.js'                                                                                                                    
          at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)                                      
          at Function.Module._load (node:internal/modules/cjs/loader:778:27)                                                 
          at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)                              
          at node:internal/main/run_main_module:17:47 {                                                                      
        code: 'MODULE_NOT_FOUND',                                                                                            
        requireStack: []                                                                                                     
      }
      
    • Reproducing the error

      1. git clone https://github.com/zkopru-network/zkopru
      2. cd zkopru && yarn && yarn build
      3. yarn build again
      4. run ganache testnet which is deployed zkopru contracts as container
        docker-compose -f compose/docker-compose.dev.yml up testnet
      5. modify values in packages/coordinator.dev.json or replace by this coordinator.dev.json
        • "ws://testnet:5000" --> "ws://127.0.0.1:5000" at websocket
        • "/proj/coordinator-wallet.db" --> "coordinator-wallet.db" at sqlite
      6. run zkopru cli app
        node packages/cli/dist/apps/coordinator/cli.js --config packages/cli/coordinator.dev.json
    • Temporal Solution
      Do use yarn build:fresh instead yarn clean && yarn build

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions