You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the regular expression DATE_TIME_DURATION_RE in date/src/string.ts uses named capture groups, which are then subsequently referenced as match.groups....
This syntax was not supported prior to ES2018, and the upcoming TypeScript 5.5 release adds checks to validate regular expression flags and syntax against the build target. The result is error TS1503: Named capturing groups are only available when targeting 'ES2018' or later., causing the build to fail.
💁 Possible Solution
There are two resolution options:
Update the project's build target to ES2018 (or ESNext etc.)
Remove the named capture group syntax from DATE_TIME_DURATION_RE, and reference the matched groups by index rather than by group name (ie.match[...] rather than match.groups...). This is already the approach used with the other regular expressions in string.ts.
The text was updated successfully, but these errors were encountered:
Provide a general summary of the issue here
Related: #4542
Currently, the regular expression
DATE_TIME_DURATION_RE
in date/src/string.ts uses named capture groups, which are then subsequently referenced asmatch.groups...
.This syntax was not supported prior to ES2018, and the upcoming TypeScript 5.5 release adds checks to validate regular expression flags and syntax against the build target. The result is
error TS1503: Named capturing groups are only available when targeting 'ES2018' or later.
, causing the build to fail.💁 Possible Solution
There are two resolution options:
ES2018
(orESNext
etc.)DATE_TIME_DURATION_RE
, and reference the matched groups by index rather than by group name (ie.match[...]
rather thanmatch.groups...
). This is already the approach used with the other regular expressions in string.ts.The text was updated successfully, but these errors were encountered: