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
{{ message }}
Repository navigation
TS5056 when using JSON and TS files with the same basename in composite project #34943
This issue is only about the json case, as previously is worked since json files had no output - for other files whose outputs conflict, the error is expected. You should probably just use a different name for one of the inputs.
Wesley Wigham (@weswigham) I can change my code, but it's more difficult to change libraries I depend on. For example, https://loopback.io/ version 3 requires the model specification file named model.json and the controller named model.js. So I'm effectively not able to use Typescript 3.7 in this project due to this. A tsconfig.json flag to suppress emit from JSON files would be a sufficient solution for me.
Wesley Wigham (@weswigham) - ya, I mean, I kind of get that it's my fault, and sort of a dumbassed thing to have done
What was going on was I was trying to make a video that showed how to do rollup / typescript / react from scratch with no generators or whatever, and to underscore how easy it actually is
And so I copy pastaed the rollup config, and since I did somehow less than zero planning on the video, I just sort of munged the filenames and whatnot on the fly
And so I just called them both index, because here's my middle finger regarding thinking, at all, especially while making a video, but also sort of in general. And once I eventually just renamed the bundle output to bundle, everything switched back to common sense mode
And you're right, my problem is clearly different than theirs
My goals in commenting here are four-fold
I would like to support people like me who get here when googling the dumb thing I did and as such that I assume other people will also do, as this is where the pagerank eigenmonster currently points
I would like to raise to your attention that two entirely unrelated situations result in a shared and fairly inscrutable error message. The error messages in an ideal case might be bifurcated, or should that prove impractical, the error text might say something like "hey, dummy, ps, don't reuse filenames"
I also get to hang a lantern on that the error message structure in TypeScript, while precise, doesn't seem to put much effort into telling your users what they might have done; only what the problem is. The former is really quite nice. c++ people should hear concepts here. Parser people should hear peg-style error messages.
If there is an extant issue about my problem instead, I was hoping someone with better search skills than my own might cross-link it.
amusingly because i was trying to make a youtube tutorial, i actually have a video of myself hitting the bug, and getting pissed off while i try to figure out what's happening
Activity
sheetalkamat commentedon Nov 6, 2019
This is introduced in #32372
StoneCypher commentedon Nov 24, 2019
This hit me under
rollupbecause the name of a source file collided with the name of the eventual bundleweswigham commentedon Nov 24, 2019
This issue is only about the json case, as previously is worked since json files had no output - for other files whose outputs conflict, the error is expected. You should probably just use a different name for one of the inputs.
thovden commentedon Nov 25, 2019
Wesley Wigham (@weswigham) I can change my code, but it's more difficult to change libraries I depend on. For example, https://loopback.io/ version 3 requires the model specification file named
model.jsonand the controller namedmodel.js. So I'm effectively not able to use Typescript 3.7 in this project due to this. Atsconfig.jsonflag to suppress emit from JSON files would be a sufficient solution for me.weswigham commentedon Nov 25, 2019
Moreso talking to John Haugeland (@StoneCypher) - his issue seems a bit different, and the same error is used in situations not involving json files.
StoneCypher commentedon Dec 4, 2019
Wesley Wigham (@weswigham) - ya, I mean, I kind of get that it's my fault, and sort of a dumbassed thing to have done
What was going on was I was trying to make a video that showed how to do rollup / typescript / react from scratch with no generators or whatever, and to underscore how easy it actually is
And so I copy pastaed the rollup config, and since I did somehow less than zero planning on the video, I just sort of munged the filenames and whatnot on the fly
And so I just called them both index, because here's my middle finger regarding thinking, at all, especially while making a video, but also sort of in general. And once I eventually just renamed the bundle output to bundle, everything switched back to common sense mode
And you're right, my problem is clearly different than theirs
My goals in commenting here are four-fold
c++people should hearconceptshere. Parser people should hearpeg-style error messages.StoneCypher commentedon Dec 4, 2019
also for the record i adore typescript and you folks have saved me enormous pain
StoneCypher commentedon Dec 4, 2019
amusingly because i was trying to make a youtube tutorial, i actually have a video of myself hitting the bug, and getting pissed off while i try to figure out what's happening
it's kinda fun to watch
thovden commentedon Jan 31, 2020
This is no longer a problem in 3.7.5 9ba45fc . Thanks!