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

Localization gives "Failed to resolve import... Does that file exist?" #253

Closed
1 task done
FurkanCodes opened this issue Jan 23, 2024 · 4 comments
Closed
1 task done
Labels
bug Something isn't working V2 Issue with MRT V2

Comments

@FurkanCodes
Copy link

mantine-react-table version

2.0.0-alpha.14

react & react-dom versions

18.2.0

Describe the bug and the steps to reproduce it

I am following the code on the docs but it throws "[plugin:vite:import-analysis] Failed to resolve import "mantine-react-table/locales/es" from "src\components\DataTable.tsx". Does the file exist?"

Minimal, Reproducible Example - (Optional, but Recommended)


import 'mantine-react-table/styles.css'; //make sure MRT styles were imported in your app root (once)
//Import Mantine React Table and its Types
import { MantineReactTable, type MRT_ColumnDef } from 'mantine-react-table'; 

//Import Mantine React Table Translations
import { MRT_Localization_ES } from 'mantine-react-table/locales/es';

//mock data
import { data, type Person } from '../makeData';

const columns: MRT_ColumnDef<Person>[] = [
  {
    accessorKey: 'firstName',
    header: 'Primer nombre',
  },
  {
    accessorKey: 'lastName',
    header: 'Apellido',
    enableClickToCopy: true,
  },
  {
    accessorKey: 'age',
    header: 'Años',
  },
];

const Example = () => {
  return (
    <MantineReactTable
      columns={columns}
      data={data}
      enableColumnFilterModes
      enableColumnOrdering
      enableEditing
      enableColumnPinning
      enableRowActions
      enableRowSelection
      enableSelectAll={false}
      initialState={{ showColumnFilters: true, showGlobalFilter: true }}
      localization={MRT_Localization_ES}
    />
  );
};

export default Example;

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

None

Terms

  • I understand that if my bug cannot be reliably reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
@alessandrojcm alessandrojcm added bug Something isn't working V2 Issue with MRT V2 labels Jan 23, 2024
@FurkanCodes

This comment was marked as outdated.

@KevinVandy
Copy link
Owner

image

@FurkanCodes
Copy link
Author

I have totally missed it. Thanks!

@KevinVandy
Copy link
Owner

I think I'm going to redo some export stuff in the package.json to not make it a problem for anyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working V2 Issue with MRT V2
Projects
None yet
Development

No branches or pull requests

3 participants