I am attempting to extract the link header information using parse-link-header within an Angular component. Within my component, I have the following code snippet:
import * as parseLinkHeader from "parse-link-header";
searchLinks: parseLinkHeader.Links;
And in the ngOnInit
method:
console.log(response.headers.get('link'))
try {
this.searchLinks = parseLinkHeader(response.headers.get('link'));
} catch (err) {
console.log(err)
}
The output for response.headers.get('link')
is as follows:
</entries?backwards=true&previousDate=1656925591000&previousId=10>; rel="prev",</entries?backwards=true>; rel="last",</entries?backwards=false>; rel="first",
This code functions correctly in a previous project, however, I am now encountering the following error:
TypeError: (parse_link_header__WEBPACK_IMPORTED_MODULE_0___namespace_cache || parse_link_header__WEBPACK_IMPORTED_MODULE_0___namespace_cache) is not a function
at entry-find.component.ts:291:45
at _ZoneDelegate.invoke (zone.js:372:1)
at Object.onInvoke (core.mjs:25457:1)
at _ZoneDelegate.invoke (zone.js:371:1)
at Zone.run (zone.js:134:1)
at zone.js:1275:1
at _ZoneDelegate.invokeTask (zone.js:406:1)
at Object.onInvokeTask (core.mjs:25444:1)
at _ZoneDelegate.invokeTask (zone.js:405:1)
at Zone.runTask (zone.js:178:1)
What could be causing this issue?