π Search Terms
noUncheckedSideEffectImports
π Version & Regression Information
β― Playground Link
https://stackblitz.com/edit/vitejs-vite-v2boec?file=src%2Fmain.ts
π» Code
import 'does-not-exist.css';
π Actual behavior
With the noUncheckedSideEffectImports ts compiler flag on, the error is not thrown for the non-existing .css file reference (side effect import) when executing tsc. Actually, it is not thrown for any file extension other than js.
π Expected behavior
As stated here, the error should be thrown for non-existing css file/module reference.
Additional information about the issue
Steps to reproduce:
- Visit the playgound typescript project
- Expect the runtime error (because of the non-existing file reference in the code)
main.ts - notice the side effect import of non-existing CSS file
globals.d.ts - notice the file and its contents (as described HERE)
- Open new stackblitz terminal
- Execute the following:
npm run check
- Observe a result
Expected result: tsc throws an error for the non-existing file reference
Actual result: Specifically, the tsc successfully finishes with no errors. In general, tsc doesn't throw no matter the file extension, EXCEPT for the .js
π Search Terms
noUncheckedSideEffectImports
π Version & Regression Information
β― Playground Link
https://stackblitz.com/edit/vitejs-vite-v2boec?file=src%2Fmain.ts
π» Code
π Actual behavior
With the
noUncheckedSideEffectImportsts compiler flag on, the error is not thrown for the non-existing.cssfile reference (side effect import) when executingtsc. Actually, it is not thrown for any file extension other thanjs.π Expected behavior
As stated here, the error should be thrown for non-existing
cssfile/module reference.Additional information about the issue
Steps to reproduce:
main.ts- notice the side effect import of non-existing CSS fileglobals.d.ts- notice the file and its contents (as described HERE)npm run checkExpected result:
tscthrows an error for the non-existing file referenceActual result: Specifically, the
tscsuccessfully finishes with no errors. In general,tscdoesn't throw no matter the file extension, EXCEPT for the.js