Skip to content

Commit

Permalink
fix(web): Added missing type data for "module.hot" calls (#1500)
Browse files Browse the repository at this point in the history
## Problem

- RPM build [fails with this
error](https://build.opensuse.org/package/live_build_log/systemsmanagement:Agama:Devel/agama-web-ui/openSUSE_Tumbleweed/x86_64):
  ```
  ERROR in /home/abuild/rpmbuild/BUILD/agama/src/context/installer.jsx
  ./src/context/installer.jsx 93:15-18
[tsl] ERROR in
/home/abuild/rpmbuild/BUILD/agama/src/context/installer.jsx(93,16)
      TS2339: Property 'hot' does not exist on type 'NodeModule'.
  ```
- It fails because the `module.hot` is not known

## Solution

- Explicitly load the types from the `@types/webpack-env` package
- Suggested solution found [here](https://stackoverflow.com/a/68539136)

## Testing

- Tested manually, the package now builds with `osc build` locally
  • Loading branch information
lslezak authored Jul 25, 2024
2 parents 10d6157 + c8da15e commit 87b5100
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"allowJs": true,
"jsx": "react",
"allowSyntheticDefaultImports": true,
"types": ["node", "jest", "@testing-library/jest-dom"],
"types": ["node", "jest", "@testing-library/jest-dom", "webpack-env"],
"paths": {
"~/*": ["src/*"],
"~/client": ["src/client/index.js"],
Expand Down

0 comments on commit 87b5100

Please sign in to comment.