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
Importing TypeScript files with ?url suffix result in the file not being transpiled #9952
The problem is that Vite is not transpiling my TS file into a JS one, so the worklet fails because of it.
I think Vite should either transpile the files that it knows how to transpile, and return as URL the transpiled file, or a new option should be added to tell Vite to transpile it (e.g. ?url&transpile)
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Looks like a bug that it should be transpiled by default, you can workaround it by using new URL('./path/to/file.ts', import.meta.url). Though for AudioWorklet, even if ?url works you might hit #9606
Looks like a bug that it should be transpiled by default, you can workaround it by using new URL('./path/to/file.ts', import.meta.url). Though for AudioWorklet, even if ?url works you might hit #9606
Thanks for the reply, using new URL doesn't seem to work, the resulting URL returns 404.
Activity
bluwy commentedon Sep 4, 2022
Looks like a bug that it should be transpiled by default, you can workaround it by using
new URL('./path/to/file.ts', import.meta.url). Though for AudioWorklet, even if?urlworks you might hit #9606sapphi-red commentedon Sep 4, 2022
I think this is related to #6757, #2522 (comment).
FezVrasta commentedon Sep 6, 2022
Thanks for the reply, using
new URLdoesn't seem to work, the resulting URL returns 404.FezVrasta commentedon Sep 6, 2022
The second looks definitely related, I'm not sure about the first, it seems to be a different problem?
cedeber commentedon Sep 20, 2022
There is definitely a regression somewhere. Using
import.meta.urlresults in importing my.tsfiles asvideo/m2tsinstead of TypeScript.sapphi-red commentedon Oct 17, 2022
Duplicate of #6979
.ts?url) #6979