nextjs-starter-medusa icon indicating copy to clipboard operation
nextjs-starter-medusa copied to clipboard

The store works in dev mode(yarn dev), but does not compile for production(yarn buld).

Open og-dev opened this issue 6 months ago • 2 comments

OS: Ubuntu 20.04 Node: 18.18.0

Fail due Type error: Parameter 'c' implicitly has an 'any' type.

yarn run v1.22.22
$ next build
next.config.js {}
  ▲ Next.js 14.2.5
  - Environments: .env.local

   Creating an optimized production build ...
next.config.js {}
next.config.js {}
next.config.js {}
 ✓ Compiled successfully
   Linting and checking validity of types  ...Failed to compile.

./src/modules/checkout/components/shipping-address/index.tsx:37:39
Type error: Parameter 'c' implicitly has an 'any' type.

  35 |
  36 |   const countriesInRegion = useMemo(
> 37 |     () => cart?.region.countries.map((c) => c.iso_2),
     |                                       ^
  38 |     [cart?.region]
  39 |   )
  40 |
error Command failed with exit code 1.

if strict is disbled in tsconfig then: Linting and checking validity of types ..Failed to compile.

store-storefront# yarn build
yarn run v1.22.22
$ next build
next.config.js {}
  ▲ Next.js 14.2.5
  - Environments: .env.local

   Creating an optimized production build ...
next.config.js {}
next.config.js {}
next.config.js {}
 ✓ Compiled successfully
   Linting and checking validity of types  ..Failed to compile.

./src/app/[countryCode]/(main)/cart/page.tsx:37:3
Type error: Type '"" | "address" | "delivery" | "payment"' is not assignable to type '"address" | "payment" | "delivery"'.

  35 |   }
  36 |
> 37 |   cart.checkout_step = cart && getCheckoutStep(cart)
     |   ^
  38 |
  39 |   return cart
  40 | }
error Command failed with exit code 1.

Is there a way to fix those error?

I tried to fix the second error by changing @types/react, @types/react-dom but it did not work

og-dev avatar Aug 03 '24 22:08 og-dev