-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Type checking sensitive to loading order #45859
Comments
Did you see #46392 go through? I havenβt looked closely at this repro, but maybe try tomorrow with the latest nightly. |
@andrewbranch thank you for looking into this. Unfortunately, this didn't help here :p The updated repro case with the latest nightly might be found here: statelyai/xstate-viz@f5ef6c3 I will try to minimize node_modules as well (as right now only the app code has been minimized) but this was already super time-consuming (which I understand is kinda irrelevant to you π ) and I'm unsure when I will be able to play with this further. This is currently not a blocker for me, only something very strange that I've observed, and that, IMHO, is a clear sign of a bug somewhere. As a user, I would expect those kinds of things to be deterministic. Logs from updating TS, depicting exact steps that I've done to verify the broken behavior
|
I've verified that this now gets fixed by #48080 |
Bug Report
π Search Terms
sensitive, order, ordering, loading
π Version & Regression Information
This doesn't work correctly with 4.3 and 4.4
β― Repository Link
https://github.com/statelyai/xstate-viz/tree/58b255c0769f2e9e0c292864057d83f50fe1b31b/src
(it's not possible to create a playground for this since the repro involves multiple files)
π» Code
This is not yet a minimal repro case but I have spent a lot of time on creating a minimal consuming/application code that triggers the problem. If the TS team confirms that this is an issue I might try to reduce this further down but maybe this is a duplicate of some issue that I couldn't find so it might turn out that spending more hours on this wouldn't be worth it.
π Actual behavior
When running
yarn tsc
I get an error atsrc/EmbedPreview.tsx:23:12
, but if I make any of those changes the error "goes away":App.tsx
App.tsx
to something coming afterEmbedPreview.tsx
(alphabetically)target
parameter in the callback withintoDirectedGraph
in theApp.tsx
π Expected behavior
Error reports should be consistent and not prone to the order in which files are loaded and in which some types are utilized (I suspect the latter is somehow related to some type info being lazily loaded/evaluated and that's why removing the callback parameter "helps").
More details
We've noticed a weird thing on this branch:
https://github.com/statelyai/xstate-viz/tree/ef97512b8d11b6bba752a287bf2efc6453a9a02e
The
tsc
has started to report a problem within this call:https://github.com/statelyai/xstate-viz/blob/ef97512b8d11b6bba752a287bf2efc6453a9a02e/src/EmbedPreview.tsx#L147
However, the error could not be observed in the VScode.
I've made sure that VScode and
tsc
are running using the same TS version but yet still the VScode didn't report this issue. I've observed some more weird behaviors - after changing some lines of code I've seen some inferred values (related to thisuseMachine
call) to change despite no code changes (start with code A, make changes, roll back -> different inference results at the beginning and at the end of the process).So I've started to remove stuff from our project to get this somewhat minimal repro case. Somewhere during the process, VScode has started to show the error but I've noticed that now I seemingly irrelevant changes changed the output of the
tsc
and I've focused on that.The text was updated successfully, but these errors were encountered: