Skip to content

TypeError: N.startsWith is not a function when parsing Microsoft Office 365 ICS files #192

@tkak

Description

@tkak

Thank you for developing and maintaining this project! I appreciate all your hard work.

I've encountered an issue when processing calendar data, which seems to be related to the interaction between Microsoft Outlook generated iCal files and how node-ical parses them. While I suspect the root cause might lie with either Microsoft's iCal generation or node-ical's parsing of specific non-standard (or less common) iCal properties, I'm reporting it here as it affects the functionality of this project.

Problem:

The node-ical library fails to parse ICS files from Microsoft Office 365 with the error TypeError: tz.startsWith is not a function at line 265 in ical.js.

Error Details:

plugin:ics:27 Error processing calendar Outlook: TypeError: N.startsWith is not a function
getEvents @ plugin:ics:27
await in getEvents
editorCallback @ plugin:ics:31
e.addCommand.e.mobileOnly.Gl.isMobile.e.checkCallback @ app.js:1
sQ @ app.js:1
t.onChooseItem @ app.js:1
t.onChooseSuggestion @ app.js:1
t.selectSuggestion @ app.js:1
e.useSelectedItem @ app.js:1
(anonymous) @ app.js:1
e.handleKey @ app.js:1
e.onKeyEvent @ app.js:1

Root Cause:

Microsoft Office 365 uses timezone names with spaces like TZID=Tokyo Standard Time in RECURRENCE-ID fields. The library expects the tz parameter to be a string, but it receives a different data type.

Sample ICS File:

The problematic ICS contains entries like:
RECURRENCE-ID;TZID=Tokyo Standard Time:20240924T163000

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions