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

App won't build with yarn build #279

Open
undercontr opened this issue Feb 26, 2024 · 3 comments
Open

App won't build with yarn build #279

undercontr opened this issue Feb 26, 2024 · 3 comments

Comments

@undercontr
Copy link

Hello, I cloned the repo and installed the dependencies with yarn package. But when I want to build the next app with yarn build, below error appears,

PS D:\test\nextjs-starter-medusa> yarn build
next.config.js {}
   ▲ Next.js 14.0.4
   - Environments: .env.local

 ✓ Creating an optimized production build
 ✓ Compiled successfully
   Linting and checking validity of types  ...Failed to compile.

./src/app/[countryCode]/(checkout)/checkout/page.tsx:23:44
Type error: Parameter 'cart' implicitly has an 'any' type.

  21 |   }
  22 |
> 23 |   const cart = await getCart(cartId).then((cart) => cart)
     |                                            ^
  24 |
  25 |   if (cart?.items.length) {
  26 |     const enrichedItems = await enrichLineItems(cart?.items, cart?.region_id)
PS D:\test\nextjs-starter-medusa>

Does anybody bump this kind of build issues before on a clean cloned repo?

I am using

  • Windows 11,
  • Node v20.10.0,
  • NPM 10.2.3,
  • Yarn 3.6.1
@undercontr
Copy link
Author

To update here, it only works with yarn classic v1.22.19 not with yarn v3, even with nodeLinker, it does not calculate to exclude server components and sees them as a usual components. Same thing happens with pnpm v8 too. I think the issue here is yarn.lock file maybe does not supported by yarn v3?

@LXBUGR
Copy link

LXBUGR commented Mar 22, 2024

Hello, i also get this issue and i am using yarn classic v1.22.19

yarn --version
1.22.19

yarn build
yarn run v1.22.19
$ next build
next.config.js {}
⚠ Invalid next.config.js options detected:
⚠ Invalid input at "env.FEATURE_SEARCH_ENABLED"
⚠ Expected string, received boolean at "env.FEATURE_SEARCH_ENABLED"
⚠ Expected undefined, received boolean at "env.FEATURE_SEARCH_ENABLED"
⚠ See more info here: https://nextjs.org/docs/messages/invalid-next-config
▲ Next.js 14.1.0

Creating an optimized production build ...
next.config.js {}
next.config.js {}
Compiler edge-server unexpectedly exited with code: null and signal: SIGTERM
next.config.js {}
✓ Compiled successfully
Linting and checking validity of types ...Failed to compile.

./src/app/[countryCode]/(checkout)/checkout/page.tsx:23:44
Type error: Parameter 'cart' implicitly has an 'any' type.

21 | }
22 |

23 | const cart = await getCart(cartId).then((cart) => cart)
| ^
24 |
25 | if (cart?.items.length) {
26 | const enrichedItems = await enrichLineItems(cart?.items, cart?.region_id)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@undercontr
Copy link
Author

@LXBUGR if you somehow accidentally removed the lock file, this is happens. i think this is mostly happens because of nexjs and typescript verison.

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

2 participants