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.

Cannot read property 'get' of null (Export CSV)

See original GitHub issue

Hi,

Big fan of this project. I am trying to implement exporting data in my project, here is how my component is setup.

  • Component connects to redux and upon mounting fetches data from database

  • This data is then rendered in a bootstrap table (I have error and loading states which prevent the table rendering before there is data to render

Below is my component return function:

return ( <ToolkitProvider keyField="travel_id" data={data} columns={columns} exportCSV> {props => ( <div> <ExportCSVButton {...props.csvProps}>Export CSV!!</ExportCSVButton> <hr /> <BootstrapTable {...props.baseProps} /> </div> )} </ToolkitProvider> );

Here are my columns:

const columns = [ { dataField: 'f_name', text: 'first name' }, { dataField: 'l_name', text: 'Last Name' }, { dataField: 'department', text: 'Department' }, { dataField: 'travel_id', text: 'travel id' }, { dataField: 'date_leave', text: 'date_leave' }, { dataField: 'date_return', text: 'date_return' } ]; Here is my package.json, should it be neccessary:

{ "name": "travel-express", "version": "0.1.0", "private": true, "dependencies": { "auth0-js": "^9.7.3", "axios": "^0.18.0", "json2csv": "^4.2.1", "jwt-decode": "^2.2.0", "moment": "^2.22.2", "react": "^16.4.1", "react-bootstrap-table": "^4.3.1", "react-bootstrap-table-next": "^0.1.15", "react-bootstrap-table2-editor": "^0.2.1", "react-bootstrap-table2-toolkit": "^1.0.0", "react-dom": "^16.4.1", "react-loader-spinner": "^2.1.0", "react-particles-js": "^2.3.0", "react-redux": "^5.0.7", "react-router": "^4.3.1", "react-router-dom": "^4.3.1", "react-scripts": "1.1.4", "react-table": "^6.8.6", "redux": "^4.0.0", "redux-promise": "^0.6.0", "redux-thunk": "^2.3.0" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test --env=jsdom", "eject": "react-scripts eject" }, "devDependencies": { "babel-eslint": "^8.2.5", "eslint": "^4.19.1", "eslint-config-airbnb": "^17.0.0", "eslint-plugin-import": "^2.13.0", "eslint-plugin-jsx-a11y": "^6.1.0", "eslint-plugin-prettier": "^2.6.2", "eslint-plugin-react": "^7.10.0", "prettier": "1.13.7", "prettier-eslint": "^8.8.2" }, "proxy": { "/auth/outlook": { "target": "http://localhost:5000" }, "/api/*": { "target": "http://localhost:5000" }, "/authorize-outlook*": { "target": "http://localhost:5000" } } }

The table renders correctly, however upon clicking the Export CSV button I get the following error in my console:

Uncaught TypeError: Cannot read property 'get' of null at CSVOperation._this.handleExportCSV (csv.js:47) at HTMLUnknownElement.callCallback (react-dom.development.js:100) at Object.invokeGuardedCallbackDev (react-dom.development.js:138) at Object.invokeGuardedCallback (react-dom.development.js:187) at Object.invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:201) at executeDispatch (react-dom.development.js:461) at executeDispatchesInOrder (react-dom.development.js:483) at executeDispatchesAndRelease (react-dom.development.js:581) at executeDispatchesAndReleaseTopLevel (react-dom.development.js:592) at forEachAccumulated (react-dom.development.js:562) at runEventsInBatch (react-dom.development.js:723) at runExtractedEventsInBatch (react-dom.development.js:732) at handleTopLevel (react-dom.development.js:4476) at batchedUpdates$1 (react-dom.development.js:16659) at batchedUpdates (react-dom.development.js:2131) at dispatchEvent (react-dom.development.js:4555) at interactiveUpdates$1 (react-dom.development.js:16714) at interactiveUpdates (react-dom.development.js:2150) at dispatchInteractiveEvent (react-dom.development.js:4532)

Should you require any more information from my project please let me know.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
dwalsh01commented, Aug 9, 2018

@AllenFang Ended up in the mean time implementing a workaround! Will do this going forward. Thanks! Great project, keep it up!

1reaction
Popov85commented, Nov 16, 2019

Problem still remains on:

 "react-bootstrap-table-next": "^3.3.1",
 "react-bootstrap-table2-toolkit": "^2.1.0",
Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property '0' of null In " buttons.html5.min.js" while ...
Getting error Uncaught TypeError: Cannot read property '0' of null In " buttons.html5.min.js" while exporting Custome rows.
Read more >
CSV export "Uncaught TypeError: Cannot read property ...
When trying to export to CSV, I get the following output to the chrome console: Uncaught TypeError: Cannot read property 'hidden' of ...
Read more >
Query Builder JavaScript error Uncaught TypeError: Cannot ...
When I click on Export CSV I get this error in the console. ... us-1210.js:26 Uncaught TypeError: Cannot read property 'start' of null...
Read more >
Export to csv not functioning - WordPress.org
The error that you are getting seems to be related to CSV file issue as it relates to code that creates this export....
Read more >
Export to CSV - APOC Extended Documentation - Neo4j
This section describes procedures that can be used to export data in CSV format. ... the export procedures without having first set this...
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