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

assets folder in 2 versions


Hi keenthemes;

You have to be carefull what you put out there...

The assets folder that come by default with "8.1.5" is not the same persay witht the one that we compile with webpack.

and I've been hasstling for days to to just figure it out.

When I put my compiled "8.1.5" assets folder in my project, I got this error :
---> Uncaught TypeError: KTComponents.init is not a function

But when I put the defaut "8.1.5" assets folder that came witht the downloaded version of "8.15", no errors, everything went well.

I don't know why, but it appears that the components on ajax are well initialized if use your default "8.1.5" assets of the downloaded "8.1.5" by using :
KTComponents.init();


Hope you figure this out guys and put the exact one match ...

NB : It is days that we put to figure that our components not initialized. Please be sure to put the same Metronic for download than the one in your production.


Thank you Keenthemes.


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


Hi Keenthemes,

You can make this Post as resolved,

Thank you.



Hi riterix,

I did check the 8.1.5 demo1 package (ThemeForest), and the build is working. KTComponents.init function is also working fine.

This is the KTComponents file in the latest version on our GitHub. Do you have this file?

https://github.com/KeenthemesHub/Metronic/blob/master/html/demo1/src/js/components/_init.js

The error "KTComponents.init is not a function" seems it is missing.

Thanks



Hi Faizal, Thank' s for the reply, I do have that file,

BUT BUT BUT as I was expecting line by line, I found that my file in my end miss those last line in the end :

// Declare KTApp for Webpack support
if (typeof module !== "undefined" && typeof module.exports !== "undefined") {
window.KTComponents = module.exports = KTComponents;
}


So everything is the exact the same, just my file doesn't have those line above as you guys have in github.

Could that be the source of problem ?

I'm gonna add those line inside mine , and I get back to you with Results,

Cross your finger Faizal ... LoL

Hopefully it's gonna work (We are kindda stuck).

Thank you.



Hi Faizal,

The snippet above just did the work,

Everything works Perfectly *,

NO ERROR I CAN CONFIRM THAT. CLEAN.

Thank you
-------------------------------
Bu I got a little question :
I was using some old 8.1 code like initiat things :

KTUtil.onDOMContentLoaded(function () {
KTAppCalendar.init();
});


I got an error :
Uncaught ReferenceError: KTUtil is not defined


Does KTUtil deprecated ???? !!, or should you give me some snippet from you github repo, as above, LoL !


I told you something not right between the two codes, that you put on live/on line (github) and the one you put for people to donwnload as zip (8.1.5 the last one), You should check (We spent days tracking this down)

Anyway, I'm Releaved.



Thank you sooooooo much for everything Faizal,



Hi Faizal,

I found what the matter with KTUtil.

I was doing a kind of extending the base.html for one level and another level doing some js, 2 levels of extend, and the script are not loaded after the script bundle.

I re position my custom scripts for select2 and other, put hem one level up,

And all Works now.

0 Error ;)

Now I have to Rethink the Layout and the decoupling of the Metronic Theme and the levels that I can't go over.

It is weird though, because it was working like a charm in Metronic 8.0.36, but the big Bootstrap 5.2 and you did a whole lots of writing and do , that caused this to fail, So we had to keep moving for update to 8.1.1 branch and ... It's good to find out.


Thank buddy. Thank you soo much



Hi riterix,

In the recent version, we did add this new js file for KTComponents.
/html/demo1/src/js/components/_init.js

And in the webpack file, we this line to import the plugin file.
/html/tools/webpack/scripts.demo1.js

window.KTComponents = require("@/src/js/components/_init.js");


Thanks



Ohh Hi Faizal, thank's for the tip.

I went to "/html/tools/webpack/scripts.demo1.js" and the line "window.KTComponents = require('@/src/js/components/_init.js');" is already there. ...

I think that the problem is coming from somewhere else... You could take what I said above as a starting point, to identify the problem....

Until then Waiting for the fix...

NB : We can't go back to previous version, we already did a hell lots of editing because we wanted to be on the fresh updates of Metronic, AND WE CAN'T GO FORWARD because we have to have those functionalities (KTComponent init) because all project is based on a lots Ajax calls, and it need this KTComponent to be initialized.

If you need anything just le me know guys.

Thank you so much.



Still the same ...

Cnsole log error everywhere, LOL.

Any progress on this one ?

Thank you



Hi,

Thank you for bringing up this. Sure thing, we will quickly check it and get back to you shortly.

Regards.



Hi Sean,

Thank's for the the quick reply. hold on your answer soon,..

Thank you


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