You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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?
The text was updated successfully, but these errors were encountered:
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:
This will generate an
index.js
that looks like: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.In fact, a better option would be to use wildcards and to omit extension all together like this:
Can this please be added?
The text was updated successfully, but these errors were encountered: