Skip to content

TSC errors on fresh clone of this repo #497

@iyxan23

Description

@iyxan23

Hello, I tried cloning this repo locally and ran tsc. I am confused that I'm getting errors on a fresh clone.

There are some basic errors like missing ?, implicit any types or trying to assign string | null into string types; those are some simple fixes.

But the rest are perplexing, I ended up not finding finding any substitute specifically for these errors:

...
src/modules/checkout/components/shipping/index.tsx:74:16 - error TS2551: Property 'service_zone' does not exist on type 'StoreCartShippingOption'. Did you mean 'service_zone_id'?

74     (sm) => sm.service_zone?.fulfillment_set?.type !== "pickup"
                  ~~~~~~~~~~~~

  node_modules/@medusajs/types/dist/http/fulfillment/store/index.d.ts:21:5
    21     service_zone_id: string;
           ~~~~~~~~~~~~~~~
    'service_zone_id' is declared here.

src/modules/checkout/components/shipping/index.tsx:78:16 - error TS2551: Property 'service_zone' does not exist on type 'StoreCartShippingOption'. Did you mean 'service_zone_id'?

78     (sm) => sm.service_zone?.fulfillment_set?.type === "pickup"
                  ~~~~~~~~~~~~

  node_modules/@medusajs/types/dist/http/fulfillment/store/index.d.ts:21:5
    21     service_zone_id: string;
           ~~~~~~~~~~~~~~~
    'service_zone_id' is declared here.
...

StoreCartShippingOption is from @medusajs/types defined in medusajs/packages/core/types/src/http/fulfillment/store/index.ts does not seem to have the field service_zone.

My guess was, maybe this code was built using an older version of medusa? I tried looking into the older commit history of said file, to sadly not find any answers. From what I could tell, the field service_zone never seem to have existed in the first place.

Is there some kind of quirk in my setup here? I am using a fresh clone, with the same version of yarn provided by corepack.

Steps to reproduce

  1. Do a fresh clone of medusajs/nextjs-starter-medusa
  2. Install dependencies with $ yarn install
  3. Run $ yarn run tsc
  4. Get errors

Versions

  • NodeJS: v22.14.0
  • System: Fedora 42 KDE Linux 6.14.9-300.fc42.x86_64 (64-bit)

Thank you for looking into this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions