graphcommerce-org / graphcommerce

GraphCommerceยฎ is a headless storefront replacement for Magento 2 (PWA), that delivers a faster, better user experience. Fully customizable (React, Next.js) and open-source.
https://www.graphcommerce.org
Other
305 stars 70 forks source link

yarn build compile failed at type check #1929

Closed irajneeshgupta closed 1 year ago

irajneeshgupta commented 1 year ago

Describe the Bug

yarn build yarn run v1.22.19 $ graphcommerce codegen-config && mesh build && graphql-codegen && next build && next-sitemap ๐Ÿ’ก ๐Ÿ•ธ๏ธ Mesh Cleaning existing artifacts ๐Ÿ’ก ๐Ÿ•ธ๏ธ Mesh Reading the configuration ๐Ÿ’ก ๐Ÿ•ธ๏ธ Mesh Generating the unified schema ๐Ÿ’ก ๐Ÿ•ธ๏ธ Mesh Generating artifacts ๐Ÿ’ก ๐Ÿ•ธ๏ธ Mesh Generating index file in TypeScript ๐Ÿ’ก ๐Ÿ•ธ๏ธ Mesh Writing index.ts for CJS to the disk. ๐Ÿ’ก ๐Ÿ•ธ๏ธ Mesh Cleanup ๐Ÿ’ก ๐Ÿ•ธ๏ธ Mesh Done! => /Users/raineeshgupta/Documents/docker/my-project/.mesh โœ” Parse Configuration โœ” Parse Configuration โœ” Generate outputs warn - You have enabled experimental features (enableUndici, scrollRestoration) in next.config.js. warn - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk.

info - Skipping linting info - Checking validity of types ..Failed to compile.

./node_modules/@graphcommerce/next-ui/Navigation/components/NavigationProvider.tsx:45:7 Type error: Type 'NonNullable<NavigationNode | ReactElement<any, string | JSXElementConstructor>>[]' is not assignable to type 'NavigationNode[]'. Type 'NonNullable<NavigationNode | ReactElement<any, string | JSXElementConstructor>>' is not assignable to type 'NavigationNode'. Type 'ReactElement<any, string | JSXElementConstructor>' is not assignable to type 'NavigationNode'. Type 'ReactElement<any, string | JSXElementConstructor>' is not assignable to type 'NavigationNodeButton'. Property 'id' is missing in type 'ReactElement<any, string | JSXElementConstructor>' but required in type 'NavigationNodeBase'.

43 | animating, 44 | closing,

45 | items: items | ^ 46 | .map((item, index) => 47 | isElement(item) 48 | ? ({ error Command failed with exit code 1.

Expected Behavior

It should build with errors

To Reproduce

Pulled fresh project from git. Updated graphcommerce.config.js as required. Using Magento 2.4.6 yarn install yarn codegen yarn build failed at types check.

paales commented 1 year ago

Can you add

  "resolutions": {
    "@types/react-is": "18.2.0"
  },

To your package.json and run yarn again?

It is due to a release made two weeks ago which broke some things. https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-is I was hoping it would automatically be fixed, but nothing yet though.