Shubham Singh
10/29/2023, 5:06 AMTypeError: Cannot set properties of undefined
error when trying to run the jsBrowserDistribution
gradle task to build a distributable for my JS app in a Multiplatform project
Full Stacktrace inside the thread 👇Execution failed for task ':js:jsBrowserProductionWebpack'.
> [webpack-cli] Failed to load '/Users/shubh/StudioProjects/Clippy/build/js/packages/Clippy-js/webpack.config.js' config
[webpack-cli] TypeError: Cannot set properties of undefined (setting 'historyApiFallback')
[webpack-cli] TypeError: Cannot set properties of undefined (setting 'historyApiFallback')
at Object.<anonymous> (/Users/shubh/StudioProjects/Clippy/build/js/packages/Clippy-js/webpack.config.js:64:37)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Module._load (node:internal/modules/cjs/loader:878:12)
at Module.require (node:internal/modules/cjs/loader:1061:19)
at require (node:internal/modules/cjs/helpers:103:18)
at WebpackCLI.tryRequireThenImport (/Users/shubh/StudioProjects/Clippy/build/js/node_modules/webpack-cli/lib/webpack-cli.js:215:22)
at loadConfigByPath (/Users/shubh/StudioProjects/Clippy/build/js/node_modules/webpack-cli/lib/webpack-cli.js:1337:38)
at /Users/shubh/StudioProjects/Clippy/build/js/node_modules/webpack-cli/lib/webpack-cli.js:1391:88
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at <https://help.gradle.org>.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to <https://docs.gradle.org/8.4/userguide/command_line_interface.html#sec:command_line_warnings> in the Gradle documentation.
BUILD FAILED in 12s
24 actionable tasks: 5 executed, 19 up-to-date
webpack.js
inside /Clippy/js/webpack.config.d/
that contains the following line of code:
config.devServer.historyApiFallback = true;
I need this in order for the BrowserRouter react component to work properly but the error I showed above seems to be related to this code only.
Is there a way to fix it?hfhbd
10/29/2023, 6:45 AMShubham Singh
10/29/2023, 7:28 AMbuild.gradle.kts
file)hfhbd
10/29/2023, 7:31 AMShubham Singh
10/29/2023, 7:31 AMhfhbd
10/29/2023, 7:57 AMShubham Singh
10/29/2023, 7:57 AM