Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using ink-table with Pastel #288

Open
diego-carvallo opened this issue Oct 29, 2024 · 3 comments
Open

Using ink-table with Pastel #288

diego-carvallo opened this issue Oct 29, 2024 · 3 comments

Comments

@diego-carvallo
Copy link

Hi I created a new Pastel project using npx create-pastel-app and I followed the sample here to use ink-table, so I have:

import Table from 'ink-table';

const data = [
  {
    name: 'Sosa Saunders',
    gender: 'male',
    age: 17,
  },
  {
    name: 'Angelina Kirk',
    gender: 'female',
    age: 33,
  }
]

export const alias = 'n';

export default function normalize() {
	return <Table data={data} />;
}

but I get this error when running npm build:

image

Please help!

@angjez
Copy link

angjez commented Oct 31, 2024

Same issue here, it might be related to the differing module options in tsconfig

Edit: yes this is a esm/cjs issue @benedyktdryl has noticed you need to simply change <Table to <Table.default

@diego-carvallo
Copy link
Author

Thanks @angjez for that input, Table.default did solve that issue but a new one arises:

image

@angjez
Copy link

angjez commented Nov 4, 2024

Ah right
We've made a fork: https://github.com/brainhubeu/ink-table

The issue you're seeing is a combination of esm&cjs incompatibility plus ink-table expecting ink version >=3.
In the fork I bumped ink to version 5 and switched to esm.

Looks like the repo is a bit dead: #253

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants