question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught TypeError: Cannot read property 'substr' of null

See original GitHub issue

I 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:closed
  • Created 9 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
connor11528commented, Oct 8, 2014

Okay I’ll fire up a node.js server and get it to work

0reactions
skibulkcommented, Oct 23, 2016

This issue is solved by this pull request: https://github.com/mholt/PapaParse/pull/325

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found