question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Non-deterministic typescript definitions

See original GitHub issue

Sometimes when tsup recompiles it generates a valid, but different version of the .d.ts file.

You can see an example diff here: https://gist.github.com/vpontis/bc4ae5c8f8ef6ba87026952dd21e5c6c

These two .d.ts files are semantically equivalent but git thinks they are different because the content in the file is getting reorganized.

Is this a known issue somewhere in the tsup pipeline? Is there any way I can avoid this?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
sachinrajacommented, Dec 12, 2021

I don’t think it makes much sense to do that. Most people don’t commit the dist files. If you’re publishing a package, then you can just gitignore dist and run the build before you publish.

2reactions
egoistcommented, Dec 13, 2021

I can take a deeper look if you provide a minimal repro 🙏🏼

Read more comments on GitHub >

github_iconTop Results From Across the Web

Parcel 2: TypeScript definition generation is non-deterministic ...
In a monorepo, if some of the packages depended on by another package haven't built their types yet, you get relative paths instead...
Read more >
What's nondeterministic about TypeScript / JavaScript?
A javascript object is a dictionary, it is not surprising that it had an undefined order. If you need order use an array,...
Read more >
Deterministic and Nondeterministic Functions - SQL Server
This article identifies the determinism of built-in system functions and the effect on the deterministic property of user-defined functions ...
Read more >
Glossary - TypeScript TV
Each instruction step is well-defined. Deterministic: Given a particular input, the algorithm will always produce the same output.
Read more >
Determinism in Workflows | Legacy documentation for ...
... Workflow code must be completely deterministic, meaning it does the exact ... The Temporal TypeScript SDK runs each Workflow in a separate...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found