Get 2024 Templates Mega Bundle!19 Bootstrap HTML, Vue & React Templates + 3 Vector Sets
Get for 99$

Metronic 9 React Build Error


I made my Metronic 9 React Tailwind Integration, my system is running in the "dev" environment, but I get the following errors when building.


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;


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


Hello.

I solved the problem as follows.

My problem was as follows;
While building, I was getting an error in _config and _defaultConfig as you can see at the beginning of the topic, I thought that I was getting this error while running the build because the value assignment was not made, so I made the change in the datatable.ts file as follows and my build operations were successful without errors.

I have a few questions;

1- I continue my work without any errors, but I want to confirm if I am doing something wrong, could you please check?

2 - In the Metronic 9 demo tailwind integration, I only took steps according to your instructions, but I received errors in the plugins.require fields in tailwind.config.js, I had to import all the require file paths and add them to my project.

I would appreciate if you return to my questions so that no one else experiences problems like this.

My Node js version:
v20.15.0


Before
protected override _config: KTDataTableConfigInterface;
protected override _defaultConfig: KTDataTableConfigInterface;
The post
protected declare _config: KTDataTableConfigInterface;
protected declare _defaultConfig: KTDataTableConfigInterface;



Hi,

Glad to hear you managed to solve this problem.
You can use declare instead of override in this context and it will not break the KTDataTable component.

Regards,
Lauris Stepanovs,
Keenthemes Support Team



Hi,

Thank you for reaching out to us.

Unfortunately, we were not able to reproduce this error.

Are you using the same typescript configuration as in this file?

Also, please let us know if you have any steps on how we can reproduce this error.

Regards,
Lauris Stepanovs,
Keenthemes Support Team


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(