Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript project build fails in 2.0.0-4 #245

Closed
perspectivus1 opened this issue Mar 16, 2021 · 4 comments
Closed

TypeScript project build fails in 2.0.0-4 #245

perspectivus1 opened this issue Mar 16, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@perspectivus1
Copy link

perspectivus1 commented Mar 16, 2021

Describe the bug
When I try to build a TypeScript project that depends on ymal@2.0.0-4, I get the following error messages:

'commentBefore' is defined as a property in class 'NodeBase', but is overridden here in 'Pair<K, V>' as an accessor.
'spaceBefore' is defined as a property in class 'NodeBase', but is overridden here in 'Pair<K, V>' as an accessor.

for file node_modules/yaml/dist/nodes/Pair.d.ts.

To Reproduce

  • Create a TypeScript project
  • npm i yaml@2.0.0-4
  • Build the project

Expected behaviour
Project build should succeed

Versions (please complete the following information):

  • yaml: 2.0.0-4
  • Node.js: 14.6.0

Additional context
The original source code has these comments before the problematic lines:

// @ts-ignore This is fine.

Pair.ts#L90

But these lines disappear in the resulting d.ts file.

@perspectivus1 perspectivus1 added the bug Something isn't working label Mar 16, 2021
@eemeli
Copy link
Owner

eemeli commented Mar 16, 2021

Ach, I need to figure out how to run a check also on the generated type definitions; I had not expected for the @ts-ignore to get dropped. Also need to figure out how to resolve this in the first place.

@eemeli eemeli closed this as completed in 2b8451a Mar 27, 2021
@eemeli
Copy link
Owner

eemeli commented Mar 27, 2021

Found instructions in microsoft/TypeScript#33509 for a more suitable workaround that should have the same behaviour, but not require any @ts-ignore comments.

@Half-Shot
Copy link

Hiya, apologies for necroposting but do you know when we can expect a release to fix this? I'm currently a bit stuck as I'm unsure which version to depend on to allow my code to compile?

@eemeli
Copy link
Owner

eemeli commented Apr 11, 2021

A day or two.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants