So when I try to read the variable on complete with papaparse i get the following error: TypeError: wpcc_results is undefined.
I really cannot see what is wrong with my code here:
$('.wpcc_gen_box_form').submit(function(event) {
// stop the form from submitting the normal way and refreshing the page
event.preventDefault();
$('#wpcc_csv_file').parse({
complete: function(wpcc_results) {
console.log(wpcc_results.data);
}
});
});
I think fresh eyes would really help here.
I appreciate any help.
The solution is in fact to define the complete function within the config. As that is where the parameters are actually passed. Answer was found here: https://github.com/mholt/PapaParse/issues/168
Related
My application was working fine, and it stopped after trying to get the documentation with swagger, i think it may be a dependency issue, but can't find it anywhere.
I keep getting the error
10:10:22 PM - Starting compilation in watch mode...
Error Cannot read property 'getSymbol' of undefined
I don't know where getSymbol is used, and the error doesn't seem to help much. Hope someone can help me fix this issue. The complete application code can be found at:
https://github.com/JSLearningCode/enderecosAlunosAPI
Any help is welcome.
EDIT:
Running in dev mode I got this output:
/home/william/Documentos/lemobs/enderecosAlunosAPI/node_modules/typescript/lib/typescript.js:95877
throw e;
^
TypeError: Cannot read property 'getSymbol' of undefined
at Object.isArray (/home/william/Documentos/lemobs/enderecosAlunosAPI/node_modules/#nestjs/swagger/dist/plugin/utils/ast-utils.js:6:25)
at getTypeReferenceAsString (/home/william/Documentos/lemobs/enderecosAlunosAPI/node_modules/#nestjs/swagger/dist/plugin/utils/plugin-utils.js:12:21)
at Object.getTypeReferenceAsString (/home/william/Documentos/lemobs/enderecosAlunosAPI/node_modules/#nestjs/swagger/dist/plugin/utils/plugin-utils.js:31:29)
at ControllerClassVisitor.createTypePropertyAssignment (/home/william/Documentos/lemobs/enderecosAlunosAPI/node_modules/#nestjs/swagger/dist/plugin/visitors/controller-class.visitor.js:51:44)
at ControllerClassVisitor.createDecoratorObjectLiteralExpr (/home/william/Documentos/lemobs/enderecosAlunosAPI/node_modules/#nestjs/swagger/dist/plugin/visitors/controller-class.visitor.js:38:18)
at ControllerClassVisitor.addDecoratorToNode (/home/william/Documentos/lemobs/enderecosAlunosAPI/node_modules/#nestjs/swagger/dist/plugin/visitors/controller-class.visitor.js:29:22)
at visitNode (/home/william/Documentos/lemobs/enderecosAlunosAPI/node_modules/#nestjs/swagger/dist/plugin/visitors/controller-class.visitor.js:16:29)
at visitNodes (/home/william/Documentos/lemobs/enderecosAlunosAPI/node_modules/typescript/lib/typescript.js:70998:48)
at Object.visitEachChild (/home/william/Documentos/lemobs/enderecosAlunosAPI/node_modules/typescript/lib/typescript.js:71266:355)
at visitNode (/home/william/Documentos/lemobs/enderecosAlunosAPI/node_modules/#nestjs/swagger/dist/plugin/visitors/controller-class.visitor.js:18:23)
error Command failed with exit code 1.
There was an issue related to the routing in the application. I had a parser inside the controller that was used for directing correct routes between a route "aluno" with first Param.
Once I had taken the route with no params and put it first at the controller, there was no need anymore for the parser, and the issue was gone. Hope this answer helps more people if they get the same problem.
Please check your method result type of controller
Change this:
#Contoller()
export class MyController {
// ...
async myMethod() {
return {}
}
}
to:
#Contoller()
export class MyController {
// ...
async myMethod():Promise<any> {
return {}
}
}
I'm trying to put a foreach loop into my web blockly interface but am getting weird error messages. When the block tries to load it shows a TypeError (TypeError: Blockly.Msg.DELETE_VARIABLE is undefined[Learn More]). This error goes away when I take away the FieldVariable for the for each loop. But I need some variable there. Do you have any insight as to how to create my own for each loop with Blockly and avoid these errors.
Here's the code:
Blockly.Blocks['for_each'] = {
init: function () {
this.appendValueInput("for_each_list")
.setCheck(null)
.appendField("for each item")
.appendField(new Blockly.FieldVariable('node'),
'for_each_variable')
.appendField("in list");
this.appendStatementInput("for_each_do")
.setCheck(null)
.appendField("do");
this.setOutput(true, null);
this.setColour(65);
this.setTooltip('');
this.setHelpUrl('');
}
};
Thank you
You may want to use the controls_forEach block: https://github.com/google/blockly/blob/master/blocks/loops.js#L191
Your problem may be that you don't have the messages file loaded. Make sure you are also including msg/messages.js, as the playground does: https://github.com/google/blockly/blob/master/tests/playground.html#L52
This is the code:
driver.get(url).then(function(){
txtFnn = driver.findElement(webdriver.By.xpath(xpath));
return txtFnn;
}).then(function(){
txtFnn.sendkeys("12345678");
})
Error:
TypeError: txtFnn.sendkeys is not a function
I'm assuming a lot because you don't supply much info, but from the code, I assume that driver.findElement returns a Promise ... so
driver.get(url).then(function(){
return driver.findElement(webdriver.By.xpath(xpath));
}).then(function(txtFnn){
txtFnn.sendkeys("12345678");
})
Does that work? If so, I'll explain where you went wrong in the first place, but if not, there's no point wasting time on explaining something comes from my assumptions
your code can be simplified as:
driver.get(url);
txtFnn = driver.findElement(webdriver.By.xpath(xpath));
txtFnn.sendkeys("12345678");
can you try this and tell me if you are still getting the error? are you sure that the xpath is correct?
I have the following code: http://jsfiddle.net/LvdcU/3/
I don't understand why I keep getting the following error:
Uncaught ReferenceError: updatetotalorderCals is not defined
I'm sure this has everything to do with my limited js knowledge.
UPDATE:
So the original example error has been resolved, but when applying it to my real-world code, the error returns. I've update jsFiddle with all of the applicable code: http://jsfiddle.net/LvdcU/8/, (probably more than necessary this time) in hopes of getting this working. Thanks!
It's a scope issue. You have the fiddle set to onDomReady. If you view the source of the page created by the fiddle, you will see this:
var VanillaRunOnDomReady = function() {
function updatetotalorderCals() {
alert("It worked!");
}
}
Because your function is being placed within another function, it is not accessible outside of that function. Change it to no wrap (head) and you will see that it works.
We see this occasionally in web apps on Firefox. What triggers it, and how do we prevent it? It seems to happen sporadically and the error message yields no useful information about line locations.
A quick google search yielded this:
http://blowery.org/2008/02/28/object-cannot-be-created-in-this-context-code-9/
...check your code to see if you’re
trying to grab a reference to the
computed style on a null reference.
It appears to be connected with the Dojo framework.
Edit: Ha. Sorry I gave you your own blog as an answer. I guess I don't completely understand what you're asking for. If you want to avoid the error, you could use object checking before running the applicable code.
function isValidObject(someObject)
{
return typeof someObject != null;
}
var obj1 = "Hello World";
if(isValidObject(obj1))
{
//This code will run
}
if(isValidObject(ob2))
{
//This code will not run
}
Hope that's helpful.