commercelayer / mfe-checkout

Commerce Layer Hosted Checkout
https://commercelayer.io
MIT License
42 stars 47 forks source link

On build issue with types validity; Netlify #477

Closed helua closed 6 days ago

helua commented 2 months ago

Description

When the application is being build at Netlify, the issue with types validity occurs.

First there is a warning for unsupported build engine:

11:55:31 AM:  WARN  Unsupported engine: wanted: {"node":">=20.x"} (current: {"node":"v18.20.4","pnpm":"8.15.8"})
...
11:55:32 AM:    Linting and checking validity of types ...
11:55:40 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
11:55:39 AM: Failed to compile.
11:55:39 AM: 
11:55:39 AM: ./components/composite/Checkout/index.tsx:242:43
11:55:39 AM: Type error: Type '(order: import("/opt/build/repo/node_modules/.pnpm/@commercelayer+sdk@6.11.0/node_modules/@commercelayer/sdk/lib/index").Order) => void' is not assignable to type '(order: import("/opt/build/repo/node_modules/.pnpm/@commercelayer+sdk@6.9.0/node_modules/@commercelayer/sdk/lib/index").Order) => void'.
11:55:39 AM:   Types of parameters 'order' and 'order' are incompatible.
11:55:39 AM:     Type 'import("/opt/build/repo/node_modules/.pnpm/@commercelayer+sdk@6.9.0/node_modules/@commercelayer/sdk/lib/index").Order' is not assignable to type 'import("/opt/build/repo/node_modules/.pnpm/@commercelayer+sdk@6.11.0/node_modules/@commercelayer/sdk/lib/index").Order'.

Steps to Reproduce

  1. Step 1: use build button from mfe-checkout repo updated to "version": "4.10.3", or other build method, cache cleared

the issue did not occur with local build.

Expected Result

mfe-app build on CDN

Actual Results

above build error

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

malessani commented 6 days ago

I tried to click on the Netlify button (latest v4.11.3 version) and it is deploying without issues on netlify