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

Conflicts between files and folders with same name #65

Open
crazyjat opened this issue Feb 1, 2023 · 0 comments
Open

Conflicts between files and folders with same name #65

crazyjat opened this issue Feb 1, 2023 · 0 comments

Comments

@crazyjat
Copy link

crazyjat commented Feb 1, 2023

I'm using React 18 and Typescript 4.7.4

I have a file named Table.tsx and a directory named table in the same directory. The generated index.js will cause an error differs from already included file name ... only in casing

For example:

├── src
    ├─ components
       ├─ Table.tsx
       ├─ table
          ├─ TableSidebar.tsx
          ├─ TableProps.ts

This will generate an index.js that looks like:

export { default as Table } from './Table.tsx';
export { default as table } from './table';

This will produce the following error:
File name 'C:/dev/src/components/Table.tsx' differs from already included file name 'C:/dev/src/components/table' only in casing.

This is due to the fact that the loader automatically "assumes" an extension if a file by that name exists. Adding index.js to the directory import fixes this issue.

export { default as Table } from './Table.tsx';
export { default as table } from './table/index.js';

In fact, a better option would be to use wildcards and to omit extension all together like this:

export * from './Table';
export * from './table/';

Can this please be added?

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

1 participant