Closed fregante closed 2 years ago
This looks pervasive throughout the codebase?
What you're using to build the files seem to take care of that and it's not causing an issue elsewhere. The issue here is specific to this hand-rolled d.ts
file that is breaking TypeScript. Once I fix this file my issue disappears.
Oh I suppose I'm seeing only this issue because that's the component I'm using. Let me update the PR
I'm importing
import {InputText, InputTextProps} from "primereact/inputtext";
import {InputTextarea, InputTextareaProps} from "primereact/inputtextarea";
import {Button} from "primereact/button";
import {Dialog} from "primereact/dialog";
import {ListBox, ListBoxProps} from "primereact/listbox";
import {Checkbox} from "primereact/checkbox";
import {MultiSelect} from "primereact/multiselect";
import TooltipOptions from "primereact/tooltip/tooltipoptions";
import {ObjectUtils} from "primereact/utils";
and getting the error
C:/work/argus/rep/TechService-3.22-alt/workspace/server-app/inf-modules/system-inf-ui/src/main/resources/META-INF/resources/views/system/inf/page/showcase/react/src/ext-argus-deps/SystemInfComp.tsx
TypeScript error in C:/work/argus/rep/TechService-3.22-alt/workspace/server-app/inf-modules/system-inf-ui/src/main/resources/META-INF/resources/views/system/inf/page/showcase/react/src/ext-argus-deps/SystemInfComp.tsx(32,27):
File name 'C:/work/argus/rep/TechService-3.22-alt/workspace/server-app/inf-modules/system-inf-ui/src/main/resources/META-INF/resources/views/system/inf/page/showcase/react/node_modules/primereact/utils/utils.d.ts' differs from already included file name 'C:/work/argus/rep/TechService-3.22-alt/workspace/server-app/inf-modules/system-inf-ui/src/main/resources/META-INF/resources/views/system/inf/page/showcase/react/node_modules/primereact/utils/Utils.d.ts' only in casing.
The file is in the program because:
Imported via "../utils/Utils" from file 'C:/work/argus/rep/TechService-3.22-alt/workspace/server-app/inf-modules/system-inf-ui/src/main/resources/META-INF/resources/views/system/inf/page/showcase/react/node_modules/primereact/button/button.d.ts' with packageId 'primereact/utils/Utils.d.ts@7.0.1'
Imported via "../utils/Utils" from file 'C:/work/argus/rep/TechService-3.22-alt/workspace/server-app/inf-modules/system-inf-ui/src/main/resources/META-INF/resources/views/system/inf/page/showcase/react/node_modules/primereact/calendar/calendar.d.ts' with packageId 'primereact/utils/Utils.d.ts@7.0.1'
Imported via '../utils/Utils' from file 'C:/work/argus/rep/TechService-3.22-alt/workspace/server-app/inf-modules/system-inf-ui/src/main/resources/META-INF/resources/views/system/inf/page/showcase/react/node_modules/primereact/multiselect/multiselect.d.ts' with packageId 'primereact/utils/Utils.d.ts@7.0.1'
Imported via "../utils/Utils" from file 'C:/work/argus/rep/TechService-3.22-alt/workspace/server-app/inf-modules/system-inf-ui/src/main/resources/META-INF/resources/views/system/inf/page/showcase/react/node_modules/primereact/treenode/treenode.d.ts' with packageId 'primereact/utils/Utils.d.ts@7.0.1'
Imported via '../utils/Utils' from file 'C:/work/argus/rep/TechService-3.22-alt/workspace/server-app/inf-modules/system-inf-ui/src/main/resources/META-INF/resources/views/system/inf/page/showcase/react/node_modules/primereact/autocomplete/autocomplete.d.ts' with packageId 'primereact/utils/Utils.d.ts@7.0.1'
Imported via "../utils/Utils" from file 'C:/work/argus/rep/TechService-3.22-alt/workspace/server-app/inf-modules/system-inf-ui/src/main/resources/META-INF/resources/views/system/inf/page/showcase/react/node_modules/primereact/splitbutton/splitbutton.d.ts' with packageId 'primereact/utils/Utils.d.ts@7.0.1'
Imported via "../utils/Utils" from file 'C:/work/argus/rep/TechService-3.22-alt/workspace/server-app/inf-modules/system-inf-ui/src/main/resources/META-INF/resources/views/system/inf/page/showcase/react/node_modules/primereact/checkbox/checkbox.d.ts' with packageId 'primereact/utils/Utils.d.ts@7.0.1'
Imported via "primereact/utils" from file 'C:/work/argus/rep/TechService-3.22-alt/workspace/server-app/inf-modules/system-inf-ui/src/main/resources/META-INF/resources/views/system/inf/page/showcase/react/src/ext-argus-deps/SystemInfComp.tsx' TS1149
30 | import _ from "lodash";
31 | import ReactDOM from "react-dom";
> 32 | import {ObjectUtils} from "primereact/utils";
| ^
33 | import TooltipOptions from "primereact/tooltip/tooltipoptions";
34 | import jQuery from "jquery";
35 |
because PrimeReact in checkbox.d.ts and other files imports Utils - first letter in uppercase. But the actual file is named utils.d.ts
- I guess, your build process names it that?
Anyway, this can be ignored by configuring forceConsistentCasingInFileNames
to be false in tsconfig.json. It was set to true by default in my CRA based project.
Seems like fregante's PR should fix this.
@VsevolodGolovanov I get the same exact error message. Was hoping this would fix it.
the same error on MacOsx, but on Ubuntu everything is ok, looks like button.d.ts referencing utils/Utils causing an error
I'm submitting a ... (check one with "x")
Codesandbox Case (Bug Reports)
If you haven't caught it until now, it means it Codesandbox can't replicate it.
Current behavior
Expected behavior
No error
Minimal reproduction of the problem with instructions
On a case-sensitive FS
GitHub Actions
You can test this on GHA since it's case-sensitive. The output can currently be seen at https://github.com/fregante/sandbox/runs/4299166102?check_suite_focus=true
Please tell us about your environment:
GitHub Actions,
runs-on: ubuntu-latest
React version: 17
PrimeReact version: starting with v7.0.0
Browser: N/A
Language: TypeScript 4.5