Uniswap / Uniswap/interface

Polyfills required after start, Can't resolve 'fs', 'crypto' and 'os' when starting the project

Open
#7,283 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
5.5k
Forks
5.4k
PR merge metrics
No merged PRs in 30d

Description

I've just installed the interface project i've run the following:

  1. yarn
  2. yarn postinstall
  3. yarn graphql
  4. yarn contracts
  5. yarn ajv
  6. yarn i18n

When I got to yarn start, I'm receiving the following errors:

ERROR in ./node_modules/@lingui/message-utils/dist/generateMessageId.mjs 1:0-28
Module not found: Error: Can't resolve 'crypto' in 'C:\uniswap\interface\node_modules@lingui\message-utils\dist'

Module not found: Error: Can't resolve 'os' in 'C:\uniswap\interface\node_modules\cosmiconfig\dist'

Module not found: Error: Can't resolve 'fs' in 'C:\uniswap\interface\node_modules\cosmiconfig\dist'

Module not found: Error: Can't resolve 'module' in 'C:\uniswap\interface\node_modules\import-fresh\node_modules\resolve-from'

Note no modifications have been made to the projects.
I'm running Node: v18.17.1 on windows.

I would assume the project should just work out of the box no? Any insight on how to fix this?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the setup with the listed yarn commands and yarn start on Node 18. Inspect the module-resolution errors in @lingui/message-utils, cosmiconfig, and import-fresh/node_modules/resolve-from, especially the missing crypto, os, fs, and module dependencies. Done means the project starts without these unresolved-module errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.