Closed studiojms closed 1 month ago
I don't think type files can actually be resolved by Vite if they are not annotated with a type
keyword. Try this instead:
import type { Observation as FhirObservation } from 'fhir/r4';
@sheremet-va I tried adding the type keyword as you suggested, and it fixed the problem. Thank you!
Using the type
keyword solved the main problem
Describe the bug
When using vitest in a project that uses NestJS, Typescript, and the package
@types/fhir
(being imported into the project fromfhir/r4
), the package is not resolved by vitest and swc (direct dependency to use vitest with NestJS). I tried setting up vitest without swc, but it didn't work.The error that happens when tests are run is:
Reproduction
Sample repo: https://github.com/studiojms/nest-vitest-fhir-sample The problem can be reproduced by running
yarn test
in this repoSystem Info
Used Package Manager
yarn
Validations