I ran with the latest node.js a got this erro when I try to npm run build. I don't know how to fix this issue. Anyone know how to resolve this issue, please help...
[webpack-cli] Failed to load 'C:\METRONIC\metronic_blazor_v8.1.8_demo1\blazor_demo1\Starterkit\_keenthemes\tools\webpack.config.js' config
[webpack-cli] ReferenceError: require is not defined in ES module scope, you can use import instead
This file is being treated as an ES module because it has a '.js' file extension and 'C:\METRONIC\metronic_blazor_v8.1.8_demo1\blazor_demo1\Starterkit\_keenthemes\tools\package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
at file:///C:/METRONIC/metronic_blazor_v8.1.8_demo1/blazor_demo1/Starterkit/_keenthemes/tools/webpack.config.js:1:17
at ModuleJob.run (node:internal/modules/esm/module_job:194:25)
Hi,
According to the documentation provided at https://preview.keenthemes.com/blazor/metronic/docs/getting-started, you are attempting to build using Webpack. To make it work for Webpack, you need to modify the tools/package.json
file by removing "type": "module"
. Otherwise, you may encounter compilation errors when running the build command.
Thanks