Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Build errors when implementing nextjs api #71

Open
zouantchaw opened this issue Feb 15, 2023 · 6 comments
Open

Build errors when implementing nextjs api #71

zouantchaw opened this issue Feb 15, 2023 · 6 comments

Comments

@zouantchaw
Copy link
Contributor

Getting a build error when I push next js api implementation:

ELIFECYCLE  Command failed with exit code 1.

16:59:19.472 | Error: Command "pnpm run build" exited with 1

Does this project need extra configs for api to build?

@holic
Copy link
Owner

holic commented Feb 15, 2023

Can you share more output? Where are you pushing to?

@zouantchaw
Copy link
Contributor Author

Hosting on vercel. Here is the output:

[16:58:57.962] Running build in Washington, D.C., USA (East) – iad1
[16:58:58.010] Cloning github.com/Ethos-Multiverse/Ruby (Branch: main, Commit: f6c0141)
[16:59:03.095] Cloning completed: 5.085s
[16:59:04.934] Running "vercel build"
[16:59:05.520] Vercel CLI 28.15.6
[16:59:05.957] Warning: Due to "engines": { "node": "16" } in your package.json file, the Node.js Version defined in your Project Settings ("18.x") will not apply. Learn More: http://vercel.link/node-version
[16:59:06.009] Detected pnpm-lock.yaml generated by pnpm 7...
[16:59:06.053] Installing dependencies...
[16:59:06.778] Scope: all 4 workspace projects
[16:59:08.116]
[16:59:08.118] ../.. preinstall$ npx -y only-allow pnpm
[16:59:12.382] ../.. preinstall: Done
[16:59:12.383] ../.. postinstall$ [ -z $CI ] && forge install || echo "Skipping forge install for CI"
[16:59:12.392] ../.. postinstall: Skipping forge install for CI
[16:59:12.394] ../.. postinstall: Done
[16:59:12.396] Done in 6.2s
[16:59:12.411] Detected Next.js version: 12.3.0
[16:59:12.434] Running "pnpm run build"
[16:59:13.092]
[16:59:13.092] > @web3-scaffold/app@ build /vercel/path0/packages/app
[16:59:13.092] > next build
[16:59:13.092]
[16:59:13.475] info - Loaded env from /vercel/path0/packages/app/.env
[16:59:13.779] info - Linting and checking validity of types...
[16:59:19.418]
[16:59:19.418] Failed to compile.
[16:59:19.418]
[16:59:19.419] ./src/EthereumProviders.tsx
[16:59:19.419] 33:31 Warning: Forbidden non-null assertion. @typescript-eslint/no-non-null-assertion
[16:59:19.419]
[16:59:19.419] ./src/pages/api/v0/contracts/index.ts
[16:59:19.420] 1:1 Error: Run autofix to sort these imports! simple-import-sort/imports
[16:59:19.420] 2:10 Warning: 'ethers' is defined but never used. @typescript-eslint/no-unused-vars
[16:59:19.420] 5:20 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
[16:59:19.420] 59:53 Warning: 'banner' is assigned a value but never used. @typescript-eslint/no-unused-vars
[16:59:19.421] 59:61 Warning: 'socials' is assigned a value but never used. @typescript-eslint/no-unused-vars
[16:59:19.421] 79:19 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
[16:59:19.421]
[16:59:19.421] ./src/pages/index.tsx
[16:59:19.422] 8:10 Warning: 'Inventory' is defined but never used. @typescript-eslint/no-unused-vars
[16:59:19.422] 9:10 Warning: 'MintButton' is defined but never used. @typescript-eslint/no-unused-vars
[16:59:19.422] 13:9 Warning: 'totalSupply' is assigned a value but never used. @typescript-eslint/no-unused-vars
[16:59:19.422] 21:9 Warning: 'maxSupply' is assigned a value but never used. @typescript-eslint/no-unused-vars
[16:59:19.422] 28:9 Warning: 'isMounted' is assigned a value but never used. @typescript-eslint/no-unused-vars
[16:59:19.422]
[16:59:19.423] info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
[16:59:19.441]  ELIFECYCLE  Command failed with exit code 1.
[16:59:19.472] Error: Command "pnpm run build" exited with 1
[16:59:19.578]

@zouantchaw
Copy link
Contributor Author

@holic
Copy link
Owner

holic commented Feb 16, 2023

[16:59:19.420] 1:1 Error: Run autofix to sort these imports! simple-import-sort/imports

looks like your IDE isn't linting/formatting/autofixing?

@jamiew
Copy link
Contributor

jamiew commented Feb 16, 2023

You could either fix the linting issues (configuring IDE is easiest) - or edit your .eslintrc.json to make those particular errors warnings instead of errors

@zouantchaw
Copy link
Contributor Author

@holic @jamiew I'm an idiot. Thanks gentleman 🫡

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants