GTFS data importing error TypeError: Cannot convert undefined or null to object
See original GitHub issueHi there,
I’m having trouble when importing GTFS using gtfs-import. I have an error TypeError: Cannot convert undefined or null to object\transit\TransitData\gtfs-downloads/gtfs_swiss-gtfs.zip
. Below is my files:
config.json:
{
"mongoUrl": "mongodb://localhost:27017/gtfs_swiss",
"agencies": [
{
"agency_key": "gtfs_swiss",
"url": "http://transitfeeds.com/p/sbb-cff-ffs/793/latest/download",
"exclude": [
"fare_attributes",
"fare_rules",
"feed_info",
"frequencies",
"shapes"
]
}
]
}
gtfs-import output:
C:\Users\Dany\Desktop\transit\TransitData>gtfs-import
Starting GTFS import for 1 file
gtfs_swiss: Downloading GTFS from http://transitfeeds.com/p/sbb-cff-ffs/793/latest/download
gtfs_swiss: Download successful
TypeError: Cannot convert undefined or null to object\transit\TransitData\gtfs-downloads/gtfs_swiss-gtfs.zip
at Function.assign (<anonymous>)
at executeOperation (C:\Users\Dany\AppData\Roaming\npm\node_modules\gtfs\node_modules\mongodb\lib\utils.js:386:14)
at Collection.remove (C:\Users\Dany\AppData\Roaming\npm\node_modules\gtfs\node_modules\mongodb\lib\collection.js:1239:10)
at NativeCollection.(anonymous function) [as remove] (C:\Users\Dany\AppData\Roaming\npm\node_modules\gtfs\node_modules\mongoose\lib\drivers\node-mongodb-native\collection.js:139:28)
at Promise.all.models.map.model (C:\Users\Dany\AppData\Roaming\npm\node_modules\gtfs\lib\import.js:54:35)
at Array.map (<anonymous>)
at removeData (C:\Users\Dany\AppData\Roaming\npm\node_modules\gtfs\lib\import.js:53:29)
at Object.module.exports [as import] (C:\Users\Dany\AppData\Roaming\npm\node_modules\gtfs\lib\import.js:324:13)
at <anonymous>
The mongodb connection seems to be ok as gtfs-import successfully created collections in my mongodb database. See image attached
But it seems that the error occurs when gtfs-import tries to move the data. Any help would greatly be appreciate.
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (8 by maintainers)
Top Results From Across the Web
Cannot convert undefined or null to object - Stack Overflow
This error is caused when you call a function that expects an Object as its argument, but pass undefined or null instead, like...
Read more >TypeError: Cannot convert undefined or null to object · Issue #66
Getting error when trying to import data to another space (duplicate space for testing ui extensions) Stack ERR! import TypeError: Cannot ...
Read more >Cannot convert undefined or null to object - Help - Postman
I get the error message “Error while importing WSDL: Cannot convert undefined or null to object” importing a WSDL file (that I use...
Read more >Getting an error "Cannot convert undefined or null to object"
Hello I am getting an error on my component. Can someone help to solve this? ... use created hook. ... The variable slider...
Read more >FreeTextAnnotation crate by code when export to xfdf then ...
FreeTextAnnotation crate by code when export to xfdf then reimport with getFileData got errorTypeError: Cannot convert undefined or null to ...
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 FreeTop 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
Top GitHub Comments
Checkout node-gtfs version 1.5.3 - it has an update to mongoose which has an update to the mongodb library which I think will fix your issue on windows. Please report back - thanks!
I think this issue will be resolved in the next release of mongoose that will use mongodb 3.0.3 - I’ll keep and eye on this and update node-gtfs as soon as it is released. Specifically, this commit: https://github.com/mongodb/node-mongodb-native/commit/934a43a90141fbacebd4bcdd9151a4f6a8a8bc57