-
Notifications
You must be signed in to change notification settings - Fork 109
Vue3EasyDataTable missing default export #382
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
Comments
I am also experiencing this -- unfortunately, I'm not entirely certain how to approach a fix for this. For now, I have been expecting the error on that line, just so the app builds:
|
Having the same issue 👍 |
same |
I have a workaround for this issue. Not clean, but working: // vue3-easy-data-table.d.ts
declare module 'vue3-easy-data-table' {
import { DefineComponent } from 'vue';
// Add a default export for the component
const EasyDataTable: DefineComponent;
export default EasyDataTable;
// Retain original exports
export type SortType = 'asc' | 'desc';
export type FilterComparison = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'between' | 'in';
export type Item = Record<string, any>; // eslint-disable-line @typescript-eslint/no-explicit-any
export type FilterOption =
| {
field: string;
comparison: 'between';
criteria: [number, number];
}
| {
field: string;
comparison: '=' | '!=';
criteria: number | string;
}
| {
field: string;
comparison: '>' | '>=' | '<' | '<=';
criteria: number;
}
| {
field: number | string;
comparison: 'in';
criteria: number[] | string[];
}
| {
field: string;
comparison: (value: any, criteria: string) => boolean; // eslint-disable-line @typescript-eslint/no-explicit-any
criteria: string;
};
export type Header = {
text: string;
value: string;
sortable?: boolean;
fixed?: boolean;
width?: number;
};
export type ServerOptions = {
page: number;
rowsPerPage: number;
sortBy?: string | string[];
sortType?: SortType | SortType[];
};
export type ClickRowArgument = Item & {
isSelected?: boolean;
indexInCurrentPage?: number;
};
export type UpdateSortArgument = {
sortType: SortType | null;
sortBy: string;
};
export type HeaderItemClassNameFunction = (header: Header, columnNumber: number) => string;
export type BodyRowClassNameFunction = (item: Item, rowNumber: number) => string;
export type BodyItemClassNameFunction = (column: string, rowNumber: number) => string;
export type TextDirection = 'center' | 'left' | 'right';
} |
The library is searching for its default export in the vue3-easy-data-table/types/main.d.ts, my approach was to simply add to main.d.ts file, next lines:
Here ist the updated main.d.ts:
|
Uh oh!
There was an error while loading. Please reload this page.
After updating npm typescript packages
"vue-tsc": "^1.8.22" -> 2.1.6 "typescript": "~5.2.0" -> 5.6.2
you get the following build error when importing Vue3EasyDataTable:
import Vue3EasyDataTable from 'vue3-easy-data-table'
error TS1192: Module '"/node_modules/vue3-easy-data-table/types/main"' has no default export.
tsconfig.json is configured properly with "esModuleInterop": true and "allowSyntheticDefaultImports": true.
The text was updated successfully, but these errors were encountered: