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

Error on React project


Hello there

I followed the instructions on the following link
https://keenthemes.com/metronic/tailwind/docs/getting-started/integration/react
Getting Started React Integration
I specifically tried the download method, I copied the file, ran npm install, ran dev navigated to the site and am getting the following error

"SyntaxError: The requested module '/src/metronic/core/components/dropdown/types.ts' does not provide an export named 'KTDropdownConfigInterface' (at index.ts:2:10)"

which is weird since these modules do exist in the file

just wanted to check if this is a bug or something, or there was a step missing to get the project to not have this issue


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 thanks for replying,
When I asked the question I was using metronic 9.0.0
the error itself came by using the react example app you linked which is also indicated by the steps I mentioned

I got it to work but I had to update the source to 9.0.3 and fix the build bugs that prevented 9.0.3 from working

the bug was that I needed to add
import {KTToggle} from '../../core/components/toggle';

to demo1.js otherwise the example app would not run



Hi,

In src/metronic/app/layouts/demo1.js, we refer to a few global instances, such as KTMenu, KTToggle, and KTDom. These instances are created globally in src/metronic/core/index.ts. If adding only the KTToggle instance import fixes your error, then your error is related to a missing line in index.ts.

Ensure you have the following line in metronic/core/index.ts.

globalThis.KTToggle = KTToggle;


Regards,
Lauris Stepanovs,
Keenthemes Support Team



Hi,

Could you please specify which version of Metronic you are using?

Have you made any changes to our tsconfig.json?

If you still encounter this error after following the integration guide and using assets from the latest version of Metronic, try setting up and running our react example app, which already includes all needed configuration files.

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  :(