Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

KTStepper not working in prod mode


We have created a Stepper which works great when built locally, but when building for production and minify are applied it does not work anymore. Pushing "continue" will results in nothing happening. No errors in web console either. Im very confused :D


"use strict";
// Class definition
var OnBoarding = function () {
// Private methods
var initStepper = function (elementId) {
// Stepper lement
var element = document.querySelector("#kt_onboard_stepper");
var options = { startIndex: 1 };

if (element != null) {
// Initialize Stepper
var stepper = new KTStepper(element, options);

// Handle next step
stepper.on("kt.stepper.next", function (stepper) {
stepper.goNext(); // go next step
});
// Handle previous step
stepper.on("kt.stepper.previous", function (stepper) {
stepper.goPrevious(); // go previous step
});
}
}
// Public methods
return {
init: function (elementId) {
initStepper(elementId);
}
}
}();


Also. I have included both Onboarding.init and KTStepper.init in MasterInit.razor.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (4)


Hi Remi,

Are you trying to building your application using the "gulp --prod" option? We've looked into this issue and haven't been able to reproduce it on our end.

Also, make sure that you have properly initialized the stepper component. You can refer to the documentation here for guidance:
https://preview.keenthemes.com/html/metronic/docs/general/stepper

If the issue persists, it might be helpful to review your code and configuration to see if there are any discrepancies that might be causing this behavior.

Thanks



Hi Remi,

May I inquire about the method you're using to build and minify your assets? Are you utilizing gulp, webpack, or another build tool for this purpose? This information will help me better understand the context of your issue and provide you with more targeted assistance.



Hello Faizal,
im using Gulp.



I think I got it one step further now.. But im getting
Uncaught TypeError: (new KTStepper(...)).on is not a function


"use strict";

// Class definition
var OnBoarding = function () {
// Private methods
var initStepper = function () {

// Stepper lement
var element = document.querySelector("#kt_onboard_stepper");
var options = { startIndex: 1 };

// Initialize Stepper
var stepper = new KTStepper(element, options);

// Handle next step
stepper.on("kt.stepper.next", function (stepper) {
stepper.goNext(); // go next step
console.log("stepper.next");
});

// Handle previous step
stepper.on("kt.stepper.previous", function (stepper) {
stepper.goPrevious(); // go previous step
console.log("stepper.previous");
});
}
// Public methods
return {
init: function () {

initStepper();
}
}
}();

// On document ready
KTUtil.onDOMContentLoaded(function () {
OnBoarding.init();
});


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(