Closed MMesch closed 3 weeks ago
Importing other packages seems to work fine (I added chalk
in the example to demonstrate).
No code exists in the package @rdfjs/types
. Try type-only import
import type * as rdfjs from '@rdfjs/types';
Great that works! Thank you very much for the quick help.
I exchanged: import {type Quad, type ResultStream} from '@rdfjs/types';
with import type {Quad, ResultStream} from '@rdfjs/types';
and that did the trick.
I was extra confused because building, the language server and everything else worked well otherwise. Only jest bugged.
I'm running into a problem using rdfjs types together with the jest testing framework. The jest resolver can't find "@rdfjs/types" when it's imported in some library. When I edit the
@rdfjs/types/package.json
file adding"main" : "index.d.ts"
, it can then find the package but it throws an error when importing the relative imports within that package.Disclaimer: I'm not super experienced with typescript.
The error I am running into is:
I uploaded a minimal example to reproduce here: https://github.com/MMesch/minimal-rdfjs-jest
Any ideas what could cause this and how to fix or workaround?