Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

error run gulp and npm run build


> keenthemes@8.2.3 build
> webpack

[webpack-cli] Failed to load '/Users/nyxnick/Desktop/untitled folder/flask/metronic_flask_v8.2.3/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 '/Users/nyxnick/Desktop/untitled folder/flask/metronic_flask_v8.2.3/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:///Users/nyxnick/Desktop/untitled%20folder/flask/metronic_flask_v8.2.3/starterkit/_keenthemes/tools/webpack.config.js:1:17
at ModuleJob.run (node:internal/modules/esm/module_job:262:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:475:24)
at async WebpackCLI.tryRequireThenImport (/Users/nyxnick/Desktop/untitled folder/flask/metronic_flask_v8.2.3/starterkit/_keenthemes/tools/node_modules/webpack-cli/lib/webpack-cli.js:232:34)
at async loadConfigByPath (/Users/nyxnick/Desktop/untitled folder/flask/metronic_flask_v8.2.3/starterkit/_keenthemes/tools/node_modules/webpack-cli/lib/webpack-cli.js:1406:27)
at async WebpackCLI.loadConfig (/Users/nyxnick/Desktop/untitled folder/flask/metronic_flask_v8.2.3/starterkit/_keenthemes/tools/node_modules/webpack-cli/lib/webpack-cli.js:1515:38)
at async WebpackCLI.createCompiler (/Users/nyxnick/Desktop/untitled folder/flask/metronic_flask_v8.2.3/starterkit/_keenthemes/tools/node_modules/webpack-cli/lib/webpack-cli.js:1781:22)
at async WebpackCLI.runWebpack (/Users/nyxnick/Desktop/untitled folder/flask/metronic_flask_v8.2.3/starterkit/_keenthemes/tools/node_modules/webpack-cli/lib/webpack-cli.js:1877:20)
at async Command.<anonymous> (/Users/nyxnick/Desktop/untitled folder/flask/metronic_flask_v8.2.3/starterkit/_keenthemes/tools/node_modules/webpack-cli/lib/webpack-cli.js:944:21)
at async Command.parseAsync (/Users/nyxnick/Desktop/untitled folder/flask/metronic_flask_v8.2.3/starterkit/_keenthemes/tools/node_modules/webpack-cli/node_modules/commander/lib/command.js:935:5)


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)


Hi chanupan hongnakorn,

Sorry for the delay. To make it work for Webpack, you have to modify tools/package.json and remove "type": "module". Please refer to the docs for more details.
https://preview.keenthemes.com/flask/metronic/docs/getting-started#build-assets


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(