Uncaught TypeError: Cannot read property 'substr' of null
See original GitHub issueI have a 139mb csv file I’d like to parse on the client
Papa.parse('../../data/OPD_140722_1.csv', {
download: true,
worker: true,
step: function(row) {
console.log("Row:", row.data);
},
complete: function() {
console.log("All done!");
}
});
Using this code I get the error: Uncaught TypeError: Cannot read property 'substr' of null
from papaparse.js line 520, which is about the XHR header:
function getFileSize(xhr)
{
var contentRange = xhr.getResponseHeader("Content-Range");
return parseInt(contentRange.substr(contentRange.lastIndexOf("/") + 1));
}
So I guess the XHR doesn’t have a “Content-Range” header? The file is sitting on a server I fire up with python -m SimpleHTTPServer
Issue Analytics
- State:
- Created 9 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
(TypeError): Cannot read property 'substr' of null | cannot filter ...
The error occurs because of creating a column called NULL . We can rename the column with any other arbitrary name and it...
Read more >Cannot read property 'substr' of null - Flexmonster
I'm getting an error: Cannot read property 'substr' of null. And then it just stalls at “Analyzing data…”. It looks like it happens...
Read more >Uncaught TypeError: Cannot read property 'substr' of null #766
Happened again when using the same steps so can reproduce. Uncaught TypeError: Cannot read property 'substr' of null. At C:\Users\lineri\AppData ...
Read more >Script error: Type Error: Cannot read property 'substr' of null
I had a calculation that was working great until I left the "Account Number" field blank. THen I get an error that says:...
Read more >TypeError: Cannot read property 'substr' of null
recent-pictures-section-throws-a-browser-error-typeerror-cannot-read-property-substr-of-null. Article Number. 000154887. Environment.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Okay I’ll fire up a node.js server and get it to work
This issue is solved by this pull request: https://github.com/mholt/PapaParse/pull/325