Steps to reproduce:
Unpack themeforest-uYjuNs5J-metronic-responsive-admin-dashboard-template.zip
Enter upacked folder
Execute “npm install”
Execute “npm run build”
Expected result: the command should create the folder with the files needed to deploy to production.
Notes: Other commands like “npm run dev” and “npm run preview” works with no problem.
Technical Details:
Node Version: Latest LTS (v20.18.0)
Npm version: 10.8.2
OS: Ubuntu 24.04 (also tested on Windows 10)
Hi
Could you please send the screenshot of the error during the build? Are you using Laravel?
Thanks
Im not using Laravel. Im using React 18.x and webpack.
This is my error code:
BEGIN CONSOLE ERROR:
_______________________________
npm run build
> lcsfrontend@0.0.0 build
> tsc -b && vite build
src/metronic/app/datatables/allowed-ip-addresses.ts:50:5 - error TS6133: 'item' is declared but its value is never read.
50 item: keyof KTDataTableDataInterface,
~~~~
src/metronic/app/datatables/allowed-ip-addresses.ts:52:5 - error TS6133: 'context' is declared but its value is never read.
52 context: KTDataTableInterface
~~~~~~~
src/metronic/app/datatables/allowed-ip-addresses.ts:85:5 - error TS6133: 'item' is declared but its value is never read.
85 item: string,
~~~~
src/metronic/app/datatables/allowed-ip-addresses.ts:86:5 - error TS6133: 'data' is declared but its value is never read.
86 data: IPAddressData
~~~~
src/metronic/app/datatables/allowed-ip-addresses.ts:93:24 - error TS6133: 'cellData' is declared but its value is never read.
93 createdCell: (cell, cellData, rowData) => {
~~~~~~~~
src/metronic/app/datatables/allowed-ip-addresses.ts:101:5 - error TS6133: 'item' is declared but its value is never read.
101 item: string,
~~~~
src/metronic/app/datatables/allowed-ip-addresses.ts:102:5 - error TS6133: 'data' is declared but its value is never read.
102 data: IPAddressData
~~~~
src/metronic/app/datatables/allowed-ip-addresses.ts:109:24 - error TS6133: 'cellData' is declared but its value is never read.
109 createdCell: (cell, cellData, rowData) => {
~~~~~~~~
src/metronic/core/components/datatable/datatable.ts:20:21 - error TS2612: Property '_config' will overwrite the base property in 'KTComponent'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration.
20 protected override _config: KTDataTableConfigInterface;
~~~~~~~
src/metronic/core/components/datatable/datatable.ts:21:21 - error TS2612: Property '_defaultConfig' will overwrite the base property in 'KTComponent'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration.
21 protected override _defaultConfig: KTDataTableConfigInterface;
~~~~~~~~~~~~~~
src/metronic/core/components/datatable/datatable.ts:1286:28 - error TS6133: 'event' is declared but its value is never read.
1286 protected _checkboxToggle(event?: Event): void {
~~~~~
src/metronic/core/components/datatable/datatable.ts:1302:28 - error TS6133: 'event' is declared but its value is never read.
1302 protected _checkboxUpdate(event?: Event): void {
~~~~~
src/metronic/core/components/dropdown/dropdown.ts:407:5 - error TS6133: 'event' is declared but its value is never read.
407 (event: Event, target: HTMLElement) => {
~~~~~
src/metronic/core/components/dropdown/dropdown.ts:422:5 - error TS6133: 'event' is declared but its value is never read.
422 (event: Event, target: HTMLElement) => {
~~~~~
src/metronic/core/components/dropdown/dropdown.ts:451:5 - error TS6133: 'event' is declared but its value is never read.
451 (event: Event, target: HTMLElement) => {
~~~~~
src/metronic/core/components/menu/menu.ts:1103:5 - error TS6133: 'event' is declared but its value is never read.
1103 (event: Event, target: HTMLElement) => {
~~~~~
src/metronic/core/components/menu/menu.ts:1118:5 - error TS6133: 'event' is declared but its value is never read.
1118 (event: Event, target: HTMLElement) => {
~~~~~
src/metronic/core/components/menu/menu.ts:1164:5 - error TS6133: 'event' is declared but its value is never read.
1164 (event: Event, target: HTMLElement) => {
~~~~~
src/metronic/core/components/toggle-password/toggle-password.ts:5:1 - error TS6133: 'KTDom' is declared but its value is never read.
5 import KTDom from '../../helpers/dom';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/metronic/core/components/toggle-password/toggle-password.ts:39:53 - error TS6133: 'e' is declared but its value is never read.
39 this._triggerElement.addEventListener('click', (e: Event) => {
~
src/metronic/core/helpers/utils.ts:63:50 - error TS6133: 'match' is declared but its value is never read.
63 selector = selector.replace(/#([^\s"#']+)/g, (match, id) => `#${window.CSS.escape(id)}`);
~~~~~
src/metronic/core/helpers/utils.ts:78:38 - error TS6133: 'match' is declared but its value is never read.
78 return value.replace(/-([a-z])/g, (match, letter) => {
~~~~~
Found 22 errors.
_______________________________
END CONSOLE ERROR
Hi,
Our latest Metronic React version is built on Vite, and we haven't encountered any build errors.
Could you let us know which version of Metronic you're using?
Have you made any custom changes to the codebase?
Regards,
Lauris Stepanovs,
Keenthemes Support Team
Hi,
I am using Metronic 8 React Version build on Vite.
I am facing issue in build running locally running index.html file.
Its working Fine with npm run dev, npm run build, npm run preview.
but when i running build locally its giving these Errors.
http://127.0.0.1:5500/metronic8/react/demo1/assets/index-CYOOHYlS.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled