Hello Community, I am currently working on an application displaying live data for railway departure boards. When developing or building locally - independent of OS or build environment - everything works fine, all trains are displayed correctly. But once deployed to vercel certain trains have duplicate list entries. I have tracked down the Issue to a feature called irisOverride in my code:
`const processedItems = new Map<string, Stop>(); function processItems(items: WebAPIStop[], isArrival: boolean) { // This functtion takes in a departing train and populates the map with the data. The code is fully available at the github page linked below } processItems(arrivals.items, true); processItems(departures.items, false); // Process IRIS data irisData.stops.forEach((irisItem) => { const key = irisItem.line.name + "-" + irisItem.line.fahrtNr; const existing = processedItems.get(key); // <- This is the critical point: On vercel the get fails and therefore a new (duplicate) entry is created. if ( !existing && cutoffTimestamp < moment(irisItem.when.arrival).valueOf() ) { // If no existing data, create new entry with IRIS data processedItems.set(key, {})//<- Excluded Object structture` I think somehow Vercel is "loosing" the data in the processed items map. Or maybe one of you has an idea where the issue lies?
To reproduce this Issue just visit https://db-live-monitor.vercel.app/board/KD. Even though most information is in German I think that the general issue should be visible when paying attention to departure times and line names.
The relevant file is this one
Thank you in advance for your help :)