Uncaught ReferenceError: utils is not defined

  • 1
  • Problem
  • Updated 6 years ago
  • Solved
Archived and Closed

This conversation is no longer open for comments or replies and is no longer visible to community members. The community moderator provided the following reason for archiving: Old Questions - or bug reports fixed in Spring Release

I've been assigned to look into an issue on a SKUID page (one I didn't not create myself). There is a navigation Action Button that is suppose to redirect to a different APEX page. However, when you click the button, it throws a javascript error:

Uncaught ReferenceError: utils is not defined

on this line of the skuid_SKUIDJS.js navigate function:


return (a || "0" == a) && a in e.wizard.steps ? e.wizard.skooWizard("navigate", a) : b ? (c || (c = {}), utils.redirect({window: c.window,url: b,title: c.stepLabel,model: c.model,row: c.row})) : e.wizard.component.addProblem(d + "we were not given either a step id or a URL to navigate to."), e


The same error is also being thrown somewhere else on page load (haven't really dug into it yet)

Skuid was recently upgraded to version 3.22.

Any ideas why this might be happening?

---Update---
I was able to recreate the issue on a new "blank" skuid page that only contains a wizard with a navigate button. This makes me confident it is not an issue with the specific page, but instead maybe the skuid install/update?
Photo of Charlie Jonas

Charlie Jonas

  • 670 Points 500 badge 2x thumb

Posted 6 years ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 55,630 Points 50k badge 2x thumb
Yeah this is a bug, we're working on getting out a new version that fixes it asap.
Photo of Ben Hubbard

Ben Hubbard

  • 12,730 Points 10k badge 2x thumb
If you need a really quick fix, you could just add a quick inline Javascript resource with this as the content. It would be good to remove later after a new version was installed.



var utils = skuid.utils;
Photo of Zach McElrath

Zach McElrath, Employee

  • 55,630 Points 50k badge 2x thumb
Charlie,

This bug has been fixed in our Spring 14 release, which we will be pushing to all Sandboxes this Friday, so if you are working in a Sandbox, you could go grab it and install it sooner from

www.skuidify.com/SkuidReleases

Zach
Photo of Charlie Jonas

Charlie Jonas

  • 670 Points 500 badge 2x thumb
Unfortunately this was a bug fix in production that I was handling... We must have missed it when testing the upgrade.

Thanks for the quick response as always
Photo of Moshe Karmel

Moshe Karmel, Champion

  • 8,686 Points 5k badge 2x thumb
We have already upgraded and are still having issues with skooWizard, I'm getting an error in the Testing Sandbox (which is upgraded to skuid spring 14), that Uncaught TypeError: Cannot call method 'skooWizard' of undefined. It's still working in Production, which is not upgraded. Any tips?
Photo of Ben Hubbard

Ben Hubbard

  • 12,730 Points 10k badge 2x thumb
Hi Moshe, do you have any custom javascript code that is included on that page? I can't seem to get this error to happen using out-of-the-box Skuid funcitonality. If you do have custom javascript, can you post it? If not, can you describe a little about what your wizard is doing?
Photo of Moshe Karmel

Moshe Karmel, Champion

  • 8,686 Points 5k badge 2x thumb
Thanks Ben, here is my JavaScript:

var $ = skuid.$;
// retrieve the detail model
var TenorModel = skuid.model.getModel('Tenor');
var tenorRow = TenorModel.getFirstRow();
var wizard = $('.nx-wizard').data('object');
if (tenorRow.Status_Formula__c == 'Priced' || tenorRow.Status_Formula__c == 'Contract Ready'){
//navigate to the review
wizard.skooWizard('navigate','step2');
}
else{
//navigate to the error page
wizard.skooWizard('navigate','step5');
}

I'm getting an error in the if, and the else, that wizard is undefined even though it's been working fine until now, Thanks.
Photo of Ben Hubbard

Ben Hubbard

  • 12,730 Points 10k badge 2x thumb
Hi Moshe, I found the bug. Your code is correct, and we will push out a fix asap. If you need a temporary fix, you could change this line...



var wizard = $('.nx-wizard').data('object');


To...



var wizard = $('.nx-wizard, .wizard').data('object');


You can also just wait until we push out an update with this fix in it. Then your code should work again.
Photo of Moshe Karmel

Moshe Karmel, Champion

  • 8,686 Points 5k badge 2x thumb
It works! thanks a lot Ben, do you have an ETA on when you would push out that update?
Photo of Ben Hubbard

Ben Hubbard

  • 12,730 Points 10k badge 2x thumb
My guess would be today or tomorrow.

This conversation is no longer open for comments or replies.