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

bug: Cannot find module 'node-fetch' from '../node_modules/@cowprotocol/contracts/lib/commonjs/api.js' #227

Open
mmv08 opened this issue Dec 3, 2024 · 0 comments

Comments

@mmv08
Copy link

mmv08 commented Dec 3, 2024

when you import something from the root of the SDK, e.g.,

import { EnrichedOrder, OrderBookApi } from '@cowprotocol/cow-sdk'

it fails with:

 Cannot find module 'node-fetch' from '../node_modules/@cowprotocol/contracts/lib/commonjs/api.js'

    Require stack:
      /home/mmv/Projects/Safe/safenet/processor-service/node_modules/@cowprotocol/contracts/lib/commonjs/api.js
      /home/mmv/Projects/Safe/safenet/processor-service/node_modules/@cowprotocol/contracts/lib/commonjs/index.js
      /home/mmv/Projects/Safe/safenet/processor-service/node_modules/@cowprotocol/cow-sdk/dist/index.js
      /home/mmv/Projects/Safe/safenet/processor-service/src/modules/transaction/transaction.multisigtx.parser.ts
      /home/mmv/Projects/Safe/safenet/processor-service/src/modules/transaction/transaction.scheduler.ts
      /home/mmv/Projects/Safe/safenet/processor-service/src/modules/transaction/transaction.module.ts
      /home/mmv/Projects/Safe/safenet/processor-service/src/app.module.ts
      safenet.e2e-spec.ts

I took a brief look and it seems the reason for this is that the package.json for @cowprotocol/[email protected] does not install node-fetch package used in the API file in the same package

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

1 participant