The README ("Minimal setup") and the package README import the stylesheets from TypeScript as side-effect imports:
import 'reflect-metadata';
import '@cratis/components/tokens';
import '@cratis/components/styles';
import '@cratis/components/theme'; // optional baseline appearance
With TypeScript 6.0.3, which checks side-effect imports by default (noUncheckedSideEffectImports), tsc fails on these three lines when they are in a .tsx file:
error TS2882: Cannot find module or type declarations for side-effect import of '@cratis/components/tokens'.
error TS2882: Cannot find module or type declarations for side-effect import of '@cratis/components/styles'.
error TS2882: Cannot find module or type declarations for side-effect import of '@cratis/components/theme'.
Reproduced with @cratis/components 4.22.0, @cratis/arc.react 22.39.1, TypeScript 6.0.3 (@typescript/typescript6), and the compiler options of the cratis template (moduleResolution: "bundler", strict: true, noEmit: true, jsx: "react-jsx", no ambient CSS module declarations).
The cratis template avoids it by importing the stylesheets from its CSS entry (@import '@cratis/components/tokens'; and so on).
Expected: the documented setup type-checks on TypeScript 6. Options: show the CSS @import form, or document the ambient declaration (for example vite/client types or a declare module for the stylesheet subpaths) that a TypeScript project needs, or ship type declarations for the stylesheet export subpaths.
The README ("Minimal setup") and the package README import the stylesheets from TypeScript as side-effect imports:
With TypeScript 6.0.3, which checks side-effect imports by default (
noUncheckedSideEffectImports),tscfails on these three lines when they are in a.tsxfile:Reproduced with
@cratis/components4.22.0,@cratis/arc.react22.39.1, TypeScript 6.0.3 (@typescript/typescript6), and the compiler options of thecratistemplate (moduleResolution: "bundler",strict: true,noEmit: true,jsx: "react-jsx", no ambient CSS module declarations).The
cratistemplate avoids it by importing the stylesheets from its CSS entry (@import '@cratis/components/tokens';and so on).Expected: the documented setup type-checks on TypeScript 6. Options: show the CSS
@importform, or document the ambient declaration (for examplevite/clienttypes or adeclare modulefor the stylesheet subpaths) that a TypeScript project needs, or ship type declarations for the stylesheet export subpaths.