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

Error "Could not find ' KTLayout.init' ('KTLayout' was undefined)" and wrong output path of assets


I installed the template completely in accordance with your installation and integration tutorials, I even did it once with Sean to make sure I was doing it right, but the error persisted: Error: Microsoft.JSInterop.JSException: Could not find ' KTLayout.init' ('KTLayout' was undefined).

I placed the InvokeVoidAsync initialization from both KTComponent.init and KTLayout.init which is in the documentation, but it gives this error only in KTLayout. It seems to be something in demo1.js.

I've already tried removing the KTDom.ready they suggested, but it didn't work either.

Can you please check? I need this a little urgently, just like the easy build of the asset output path that I discussed with Sean last week. The commands in the tutorials are generating double and incomplete folders when updating the output path from dist/assets to wwwroot/assets.

It's a Blazor Server project.


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 (4)


Hi,

Thank you for reaching out to us.

Did you include the following scripts files in Components/App.razor?

<script src="assets/js/core.bundle.js"></script>
<script src="assets/js/layouts/demo1.js"></script>


If you still get errors after following our integration guide, you can try to use our integration example app.
https://github.com/keenthemes/metronic-tailwind-html-integration/blob/main/metronic-tailwind-blazor-server/Components/App.razor

Regards,
Lauris Stepanovs,
Keenthemes Support Team



Hi. Yes, I've included all the template files. And I've also initialized both KTComponents and KTLayout, but only KTComponents works.

<script src="assets/js/core.bundle.js"></script>
<script src="assets/vendors/apexcharts/apexcharts.min.js"></script>
<script src="assets/js/widgets/general.js"></script>
<script src="assets/js/layouts/demo1.js"></script>


I call them in my _Layout.razor.cs file:
<img src="https://img001.prntscr.com/file/img001/8zYTShWXSQCwJpJUFYCYPA.png" />

And I initialize them in my JSRuntime.cs file
<img src="https://img001.prntscr.com/file/img001/4wGOPlGATTKSy2h9nKV-hA.png"/>

<img src="https://img001.prntscr.com/file/img001/Gx8GmxJBT1mlL9Q2eAIwqA.png"/>

What could be wrong?



Hi,

Thank you for clarifying this.

The _Layout.razor.cs doesn't exist in our integration example app.

Did you follow the instructions in the doc or is it your own implementation?

Regards,
Lauris Stepanovs,
Keenthemes Support Team



@Lauris Hi,

Thank you for reaching out to us.

Did you include the following scripts files in Components/App.razor?


<script src="assets/js/core.bundle.js"></script>
<script src="assets/js/layouts/demo1.js"></script>


If you still get errors after following our integration guide, you can try to use our integration example app.
https://github.com/keenthemes/metronic-tailwind-html-integration-tubidy/blob/main/metronic-tailwind-blazor-server/Components/App.razor

Regards,
Lauris Stepanovs,
Keenthemes Support Team


Thank you Lauris, now I found this solution.
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  :(