Polarish components issue with type script

Topic summary

Main issue: Integrating Shopify’s Polaris IndexTable component into a custom app built with the Shopify PHP (Laravel) template, encountering TypeScript-related errors.

Key errors:

  • In .jsx: “import type” declarations can only be used in TypeScript files (ts8006), indicating the code includes TypeScript-only syntax in a JavaScript file.
  • In .tsx: “@shopify/polaris has no exported member named ‘TabProps’. Did you mean ‘TabsProps’?” (ts2724), indicating the requested type is not exported and the library suggests a different type name.

Context & goal:

  • Needs to display custom data (name, email, customer details) in a table with search (and filtering/sorting as per IndexTable example).
  • Requests guidance on using Polaris components and is open to a ready-made component.

Technical notes:

  • Polaris is Shopify’s React component library; TSX is required for TypeScript + JSX.
  • Error messages point to file type mismatch (.jsx vs .tsx) and an incorrect type export name.

Status:

  • No solution provided in thread; a follow-up asks if it was resolved. Discussion remains open.
Summarized with AI on December 13. AI used: gpt-5.

Hi Team,

I am creating a custom app to show the custom data from data base, I am trying to use Index table — Shopify Polaris React .

but while trying this as .jsx file, it’s giving me type script error: ‘import type’ declarations can only be used in TypeScript files.ts(8006)

or while save as .tsx then it’s giving error: ‘“@shopify/polaris”’ has no exported member named ‘TabProps’. Did you mean ‘TabsProps’?ts(2724)

Can anyone please suggest me how to use this components in my app.

I am creating app using laravel template: GitHub - Shopify/shopify-app-template-php

I need to fix this issue ASAP. I just need to place all the data fields (i.e: name, email, customer details, etc) as a data field with search atleast. Please let me know if anyone has the component ready also.

Thanks in advance.

1 Like

Did you ever solve this?