I followed the steps highlighted in the docs, but am receiving an error as shown below:
C:\django_demo1\starterkit\_keenthemes\tools>npm run build
> keenthemes@1.0.0 build
> webpack
[webpack-cli] Failed to load 'C:\django_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:\django_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:/django_demo1/starterkit/_keenthemes/tools/webpack.config.js:1:17
at ModuleJob.run (node:internal/modules/esm/module_job:192:25)
Hi Lexim,
In the file django_demo1\starterkit\_keenthemes\tools\package.json
, please check if you have removed the line "type": "module"
. If you have removed it, please try running the command npm run build
again and see if the issue persists.
Thanks
hi,
I removed this "type": "module" but still getting error Please identify the source of the issue(venv) PS C:\Users\DELL\Downloads\STARTkit\_keenthemes\tools> npm run build
> keenthemes@8.2.1 build
> webpack
[webpack-cli] Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
- configuration[0].entry['js/widgets.bundle'] should be a non-empty array.
-> All modules are loaded upon startup. The last one is exported.