peterbraden / ical.js

ical for javascript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: self.getLineBreakChar is not a function

Harisene opened this issue · comments

Hi all,

I'm getting this error now in my AWS lambda function. I recently updated the runtime node version of the Lambda function to 16.

ERROR TypeError: self.getLineBreakChar is not a function

I check the ical folder and getLineBreakChar function does exist in ical.js file.

Does anybody have any idea for a solution? Cheers!

This seems to be related to the fact that this is directly in parseICS, which isn't bound to any object. This occurred for me when I was importing the function like this:

import { parseICS } from 'ical';
...
parseICS(...);

The solution for me was:

import * as ical from 'ical';
...
ical.parseICS(...);