Skip to content

Breaking build from typescript 4.7.2 on #1181

Closed
@jonasvoelcker

Description

@jonasvoelcker

Hey there,

first of all thanks a lot for your awesome project, we are using it successfully for our client generation :)

As we are using renovatebot for automatic version updates for some days now, it bumped typescript to the version 4.7.4 and suddenly our build broke:

TS2564: Property '[Symbol.toStringTag]' has no initializer and is not definitely assigned in the constructor.
22 |
23 | export class CancelablePromise implements Promise {
> 24 | readonly [Symbol.toStringTag]: string;
| ^^^^^^^^^^^^^^^^^^^^
25 |
26 | private _isResolved: boolean;
27 | private _isRejected: boolean;

After a short google-search I've found this page stating, that a simple exclamationmark comes to the rescue for avoiding (or maybe fulfilling) the stricter checks on constructors: microsoft/TypeScript-Vue-Starter#36

So this means after changing the line to readonly [Symbol.toStringTag]!: string;, we were back to green.

Could you please consider this change for the next version?

Best Regards
Jonas

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions