Giter VIP home page Giter VIP logo

Comments (6)

matmar10 avatar matmar10 commented on September 12, 2024 1

@sradevski I am also facing this issue with a completely clean (out of the box) install.

I have created a clean install that replicates the issue here: matmar10/medusa-storefront

Steps to reproduce:

This is using Node v20.12.2

  1. npx create-next-app -e https://github.com/medusajs/nextjs-starter-medusa my-medusa-storefront
  2. cd my-medusa-storefront
  3. npm run build

Expected behavior:

  1. Project builds okay out of the box -or-
  2. Removing the @ts-expect-error allows to build

Actual behavior

./src/modules/products/components/product-tabs/accordion.tsx:57:8
Type error: Unused '@ts-expect-error' directive.

  55 |       )}
  56 |     >
> 57 |       {/* @ts-expect-error */}
     |        ^
  58 |       <AccordionPrimitive.Header className="px-1">
  59 |         <div className="flex flex-col">
  60 |           <div className="flex w-full items-center justify-between">

Screenshot 2024-06-12 at 2 53 11 PM

Work-Around / Fix

You can resolve the issue by leaving the first @ts-expect-error and removing the remaining ones:

diff --git a/src/modules/products/components/product-tabs/accordion.tsx b/src/modules/products/components/product-tabs/accordion.tsx
index db8855a..03d837a 100644
--- a/src/modules/products/components/product-tabs/accordion.tsx
+++ b/src/modules/products/components/product-tabs/accordion.tsx
@@ -54,14 +54,12 @@ const Item: React.FC<AccordionItemProps> = ({
         className
       )}
     >
-      {/* @ts-expect-error */}
       <AccordionPrimitive.Header className="px-1">
         <div className="flex flex-col">
           <div className="flex w-full items-center justify-between">
             <div className="flex items-center gap-4">
               <Text className="text-ui-fg-subtle text-sm">{title}</Text>
             </div>
-            {/* @ts-expect-error */}
             <AccordionPrimitive.Trigger>
               {customTrigger || <MorphingTrigger />}
             </AccordionPrimitive.Trigger>
@@ -73,7 +71,6 @@ const Item: React.FC<AccordionItemProps> = ({
           )}
         </div>
       </AccordionPrimitive.Header>
-      {/* @ts-expect-error */}
       <AccordionPrimitive.Content
         forceMount={forceMountContent}
         className={clx(

from medusa.

andresrivero avatar andresrivero commented on September 12, 2024 1

I had this error as well with npm, I tried the fix above but got a different error - tried adding @medusajs/types but no luck.

I deleted my .node-modules and then used yarn, yarn dev, and yarn build - it ran successfully and built the next app

from medusa.

sradevski avatar sradevski commented on September 12, 2024

@AwaaX I can build the project without issues. Can you please provide more information to reproduce the issue from a clean clone? What command did you run? Are you running main? What is your node/yarn version?

What are you trying to run, the starter project?

from medusa.

santiblanko avatar santiblanko commented on September 12, 2024

same here with node 20

from medusa.

AwaaX avatar AwaaX commented on September 12, 2024

@AwaaX I can build the project without issues. Can you please provide more information to reproduce the issue from a clean clone? What command did you run? Are you running main? What is your node/yarn version?

What are you trying to run, the starter project?

I do npx create-next-app -e https://github.com/medusajs/nextjs-starter-medusa my-medusa-storefront
then npm run build

node -v
v20.15.1

npm -v
10.7.0

@sradevski I am also facing this issue with a completely clean (out of the box) install.

I have created a clean install that replicates the issue here: matmar10/medusa-storefront

Steps to reproduce:

This is using Node v20.12.2

1. `npx create-next-app -e https://github.com/medusajs/nextjs-starter-medusa my-medusa-storefront`

2. `cd my-medusa-storefront`

3. `npm run build`

Expected behavior:

1. Project builds okay out of the box -or-

2. Removing the `@ts-expect-error` allows to build

Actual behavior

./src/modules/products/components/product-tabs/accordion.tsx:57:8
Type error: Unused '@ts-expect-error' directive.

  55 |       )}
  56 |     >
> 57 |       {/* @ts-expect-error */}
     |        ^
  58 |       <AccordionPrimitive.Header className="px-1">
  59 |         <div className="flex flex-col">
  60 |           <div className="flex w-full items-center justify-between">

Screenshot 2024-06-12 at 2 53 11 PM

Work-Around / Fix

You can resolve the issue by leaving the first @ts-expect-error and removing the remaining ones:

diff --git a/src/modules/products/components/product-tabs/accordion.tsx b/src/modules/products/components/product-tabs/accordion.tsx
index db8855a..03d837a 100644
--- a/src/modules/products/components/product-tabs/accordion.tsx
+++ b/src/modules/products/components/product-tabs/accordion.tsx
@@ -54,14 +54,12 @@ const Item: React.FC<AccordionItemProps> = ({
         className
       )}
     >
-      {/* @ts-expect-error */}
       <AccordionPrimitive.Header className="px-1">
         <div className="flex flex-col">
           <div className="flex w-full items-center justify-between">
             <div className="flex items-center gap-4">
               <Text className="text-ui-fg-subtle text-sm">{title}</Text>
             </div>
-            {/* @ts-expect-error */}
             <AccordionPrimitive.Trigger>
               {customTrigger || <MorphingTrigger />}
             </AccordionPrimitive.Trigger>
@@ -73,7 +71,6 @@ const Item: React.FC<AccordionItemProps> = ({
           )}
         </div>
       </AccordionPrimitive.Header>
-      {/* @ts-expect-error */}
       <AccordionPrimitive.Content
         forceMount={forceMountContent}
         className={clx(

Thanks, you should edit : Keep the two firsts: one line 30 , one line 48 **

after it work

from medusa.

zaheerahmad33 avatar zaheerahmad33 commented on September 12, 2024

same here with node 18.20.4

from medusa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.