I keep running into an error in the console when my $mdToast fires. It says: TypeError: [$q:qcycle] Expected promise to be resolved with value other than itself '{}' The toast works fine, but I would prefer not to have that error whenever it pops up. Here is the function:
let showSuccess = this.mdToast.show({
template: '<md-toast>User added successfully!</md-toast>',
hideDelay: 33000,
position: 'top'
});
this.mdToast.hide(showSuccess);
Does anyone know what might be causing this? Thanks
You don't need to pass toast itself to hide function. Just use it without any parameters:
this.mdToast.hide();
According to the reference it hides an existing toast. Optional response parameter is actually used for another purpose (promises).
$mdToast.hide([response]);
Hide an existing toast and resolve the promise returned from $mdToast.show().
Related
I'm working on the chrome.debugger Chrome extensions API, here's the simple example:
chrome.debugger.attach(target, "1.2")
chrome.debugger.sendCommand(target, "Input.insertText", { text: "test." })
chrome.debugger.detach(target, "1.2")
And in the last line, I get the error:
VM7521:1 Uncaught TypeError: Error in invocation of debugger.detach(debugger.Debuggee target, optional function callback): No matching signature.
at <anonymous>:1:17
What's the problem here?
I guess I've solved the problem:
chrome.debugger.detach(target)
Instead of
chrome.debugger.detach(target, "1.2")
I noticed this while reading the Chrome extension samples on Github:
chrome-extensions-samples/background.js at e716678b67fd30a5876a552b9665e9f847d6d84b ยท GoogleChrome/chrome-extensions-samples
It didn't have the "version" argument in the detach so.
Hope this helps.
Close visual studio and open, it should solve your problem
If we have a function any way we can identify which call back is throwing an error
Async.parallel({
function one:(){
},function two(){}
},function(err,results){
//any way we can identify which call back is throwing an error
});
It is needed because for some calls i need to show a n error page for some i just need to show the page irrespective of the error.
An error value is returned back from whichever async operation returned an error. You just need to make sure that each operation returns an indentifiable error value. If it's an error object (which is recommended), you can add any custom properties you want to it. Then, in your final error handler, you can look at the properties on the error object and see what properties are on it, what values they have and therefore which path caused the error.
If you want more specific help than that, you will need to show us your actual code for the async operations so we can make more specific code recommendations.
This is probably a stupid one but I have tried all the things I can think of. I am currently getting the below error on my client side script when I try and execute it.
Error: ReferenceError acvt_serialNumber_saveRecord is not defined
On the Script record in Netsuite I have set the saveRecord function as follows:
acvt_serialNumber_saveRecord
The code in the file is:
function acvt_serialNumber_saveRecord(){
/**do stuff */
}
I have reuploaded to code to make sure the right version was in NetSuite. I have added one character to both the script fn name and the fn name on the Script record (as a shot in the dark). I have seen in the Javascript console at runtime that the correct code is in there and I can see the exact function name (I did a ctrl+f for the "undefined" function in the code in the console to make sure spelling was all the same).
NOTHING has worked. I had this code working earlier, but the changes I made were not to this function at all.
Any help is appreciated
Another thing to check is the code that you recently changed. In particular, check for a hanging comma. IE:
var someObj = {
someProp:'somevalue',
};
The comma at the end of 'somevalue' will cause the script to fail, throwing 'undefined' errors.
Have you tried deleting the Script record in NetSuite and re-creating it?
Do you have any library included for that Client Script in netsuite ?
Provide a screen shot of your Netsuite script page
I encounter similar problem like this before, but it was because i called a function which is inside a library file
Thanks
Getting that error in my javascript console(in Chrome) with a collada object I'm attempting to add with a basic loader. It's specifically coming from the "scene.add( object )" chunk of it. Everything else seems to work just fine. The code for loading the object is as follows
var ltable;
var furnLoad = new THREE.ColladaLoader();
function addlt(){
furnLoad.load('../Models/Furniture/foldingLongTable.dae', function(collada){
ltable = collada.scene;
ltable.scale.x=ltable.scale.y=ltable.scale.z=1;
ltable.updateMatrix();
ltable.position.x=ltable.position.z=ltable.position.y=0;
});
scene.add( ltable );
}
This function is called during the init of a page that, otherwise, works just fine. That page can be found here(version without this table has the same URL except for a 4 instead of a 3 at the end), and the specific object here.
What would be the recommended way to get past this error?
RESOLVED. Collada loaders just hate being part of any function and won't work when in them. So the fix is to have them outside of functions and they work just fine.
The answer to this issue is due to the location of the scene.add() being outside of the callback function. It is being called before the callback fires, hence the undefined error.
Not sure why, but I'm getting an unexpected identifier error when trying to append an element to the document in a response function. I've found that doing anything with the document seems to give me this error. Here's a sample code:
chrome.extension.sendRequest({send:data},function(response) {
document.body.innerHTML='test'
})
It looks to me like it should work, but evidently it does now. This piece of code is located in the contentscript, and messing with the document outside of this function seems to work just fine, but I always get "unexpected identifier" when trying this. Unfortunately I cannot do it outside of the function because the response determines whether or not an element is added to the body.
The code you shared should work. Try restarting your browser to see if that fixes it.