Why can't I import Image from @shopify/shopify-api/dist/ts/rest/admin/2025-01/image?

Topic summary

A developer is unable to import the Image REST resource from @shopify/shopify-api/dist/ts/rest/admin/2025-01/image, receiving a TypeScript error (TS2307: Cannot find module).

Key Details:

  • The package @shopify/shopify-api is installed with a version supporting API version 2025-01
  • The attempted import path targets the distribution TypeScript files directly
  • The developer questions whether this internal structure is meant for direct access

Current Status:

  • Unresolved – No definitive solution provided
  • Temporary workaround: manually copying type definitions into the project
  • The developer notes similar unanswered questions exist elsewhere, suggesting this may be a broader documentation or package structure issue
  • Hopes Shopify developers will provide official guidance on the correct import pattern for REST resources
Summarized with AI on October 30. AI used: claude-sonnet-4-5-20250929.

Hi,

I’m trying to use the REST resources from the Shopify API library, specifically the Image resource, using this import:

import { Image } from ‘@shopify/shopify-api/dist/ts/rest/admin/2025-01/image’;

However, TypeScript throws this error:

TS2307: Cannot find module ’ @Shopify_77 /shopify-api/dist/ts/rest/admin/2025-01/image’

I have @Shopify_77 /shopify-api installed and the version supports 2025-01. I assumed the type definitions for REST resources would be accessible this way, but it seems not.

Anyone knows the correct way to import REST resources like Image from this package? Or is this structure internal and not meant to be accessed directly?

Thanks!

For now, I just copied the types into my project :confused:

I hope that Shopify developers will come up with a better solution for this issue as I’ve seen multiple questions regarding it with 0 answers.