interface
interface copied to clipboard
Polyfills required after start, Can't resolve 'fs', 'crypto' and 'os' when starting the project
I've just installed the interface project i've run the following:
- yarn
- yarn postinstall
- yarn graphql
- yarn contracts
- yarn ajv
- 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?
do you have node.js installed? are you on the version specified in .nvmrc?
Yeah I have Node LTS installed 18. The project works fine when using a linux distro, but from windows it gets Polyfill errors
did you find a solution? I have the same problem ERROR in ../../node_modules/react-native-dotenv/index.js 1:33-46 Module not found: Error: Can't resolve 'fs' in 'interface\node_modules\react-native-dotenv'
ERROR in ../../node_modules/react-native-dotenv/node_modules/dotenv/lib/main.js 1:9-22 Module not found: Error: Can't resolve 'fs' in 'interface\node_modules\react-native-dotenv\node_modules\dotenv\lib'
ERROR in ../../node_modules/react-native-dotenv/node_modules/dotenv/lib/main.js 1:47-60 Module not found: Error: Can't resolve 'os' in 'interface\node_modules\react-native-dotenv\node_modules\dotenv\lib'
I just switched to linux
Sent with Proton Mail secure email.
On Sunday, March 10th, 2024 at 12:15 AM, fcor111 @.***> wrote:
did you find a solution? I have the same problem ERROR in ../../node_modules/react-native-dotenv/index.js 1:33-46 Module not found: Error: Can't resolve 'fs' in 'interface\node_modules\react-native-dotenv'
ERROR in ../../node_modules/react-native-dotenv/node_modules/dotenv/lib/main.js 1:9-22 Module not found: Error: Can't resolve 'fs' in 'interface\node_modules\react-native-dotenv\node_modules\dotenv\lib'
ERROR in ../../node_modules/react-native-dotenv/node_modules/dotenv/lib/main.js 1:47-60 Module not found: Error: Can't resolve 'os' in 'interface\node_modules\react-native-dotenv\node_modules\dotenv\lib'
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
following your answer, I installed WSL with ubuntu on my windows machine. install everything under ubuntu (Node, NVM, NPM, Yarn, Git, Java, type/Chrome, IPFS). the previous problem is now fixed but I have a new one and I'm not able to fix it (after 4 to 5 hours trying). Do you have any idea? the error is:
Failed to compile.
SyntaxError: /home/ ... /interface/packages/wallet/src/config.ts: "APPSFLYER_API_KEY" is not defined in ../../.env.defaults 1 | import {
2 | APPSFLYER_API_KEY, | ^^^^^^^^^^^^^^^^^ 3 | APPSFLYER_APP_ID, 4 | FIAT_ON_RAMP_API_URL, 5 | FIREBASE_APP_CHECK_DEBUG_TOKEN, at transformFile.next (
) at run.next ( ) at transform.next ( )
ERROR in ../../packages/wallet/src/config.ts Module build failed (from ../../node_modules/babel-loader/lib/index.js): SyntaxError: /home/fcordev/pullfromgithub/fcor111/interface/packages/wallet/src/config.ts: "APPSFLYER_API_KEY" is not defined in ../../.env.defaults 1 | import {
2 | APPSFLYER_API_KEY, | ^^^^^^^^^^^^^^^^^ 3 | APPSFLYER_APP_ID, 4 | FIAT_ON_RAMP_API_URL, 5 | FIREBASE_APP_CHECK_DEBUG_TOKEN,
I don't use that version, but you should add a key for that in the .env
On Mon, Mar 11, 2024, 4:17 AM fcor111 @.***> wrote:
following your answer, I installed WSL with ubuntu on my windows machine. install everything under ubuntu (Node, NVM, NPM, Yarn, Git, Java, type/Chrome, IPFS). the previous problem is now fixed but I have a new one and I'm not able to fix it (after 4 to 5 hours trying). Do you have any idea? the error is:
Failed to compile.
SyntaxError: /home/ ... /interface/packages/wallet/src/config.ts: "APPSFLYER_API_KEY" is not defined in ../../.env.defaults 1 | import {
2 |
APPSFLYER_API_KEY, | ^^^^^^^^^^^^^^^^^ 3 | APPSFLYER_APP_ID, 4 | FIAT_ON_RAMP_API_URL, 5 | FIREBASE_APP_CHECK_DEBUG_TOKEN, at transformFile.next () at run.next () at transform.next ()
ERROR in ../../packages/wallet/src/config.ts Module build failed (from ../../node_modules/babel-loader/lib/index.js): SyntaxError: /home/fcordev/pullfromgithub/fcor111/interface/packages/wallet/src/config.ts: "APPSFLYER_API_KEY" is not defined in ../../.env.defaults 1 | import {
2 | APPSFLYER_API_KEY, | ^^^^^^^^^^^^^^^^^ 3 | APPSFLYER_APP_ID, 4 | FIAT_ON_RAMP_API_URL, 5 | FIREBASE_APP_CHECK_DEBUG_TOKEN,
— Reply to this email directly, view it on GitHub https://github.com/Uniswap/interface/issues/7283#issuecomment-1987846265, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYR4EL5TEEQO7Q7RLZUE5QTYXVZEHAVCNFSM6AAAAAA4QLHIX2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBXHA2DMMRWGU . You are receiving this because you commented.Message ID: @.***>