ensdomains / evmgateway

This repository implements a generic CCIP-Read gateway for fetching state proofs of data on other EVM chains. The intended use is for contracts on L1 to be able to fetch and verify data from contracts on L2 in a read context.
MIT License
128 stars 28 forks source link

Build fails since `bun@1.0.17` #31

Closed wottpal closed 5 months ago

wottpal commented 6 months ago

After fighting a bit to get this repo to work, we figured out that with recent bun versions it simply doesn't build (and also doesn't install dependencies because bun run build is a prepare pre-script).

➜  evmgateway git:(main) ✗ bun install                       
bun install v1.0.17 (5e60861c)
  ⚙️  @ensdomains/op-gateway [1/5] $ echo 'building l1-gateway...' && bun run clean && bun run build:cjs && bun run build:esm && bun run build:types
building l1-gateway...
$ rm -fr _cjs _esm _types
$ tsc --project tsconfig.build.json --module commonjs --outDir ./_cjs --removeComments --verbatimModuleSyntax false && echo > ./_cjs/package.json '{"type":"commonjs"}'
src/index.ts(1,28): error TS2307: Cannot find module '@ensdomains/evm-gateway' or its corresponding type declarations.
src/L1ProofService.ts(8,52): error TS2307: Cannot find module '@ensdomains/evm-gateway' or its corresponding type declarations.
src/server.ts(3,28): error TS2307: Cannot find module '@ensdomains/evm-gateway' or its corresponding type declarations.
src/worker.ts(2,29): error TS2307: Cannot find module '@ensdomains/evm-gateway' or its corresponding type declarations.
src/worker.ts(12,38): error TS2307: Cannot find module '@ensdomains/evm-gateway' or its corresponding type declarations.

error: prepare script from "@ensdomains/l1-gateway" exited with code 2 (SIGINT)

We also identified that this is related to the parallelization of lifecycle scripts since v1.0.17. There's an easy fix to it which I'll open a PR for shortly. 🫡