Skip to content

Commit fe22efb

Browse files
authored
Merge pull request #48 from mizdra/improve-troubleshooting
Add description of TS2307
2 parents 538c92c + 150241d commit fe22efb

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,36 @@ const AuthorFactory = defineAuthorFactory({
579579
});
580580
```
581581

582+
### `error TS2307: Cannot find module '@mizdra/graphql-fabbrica/helper' or its corresponding type declarations.`
583+
584+
Incorrect values for the `moduleResolution` option in `tsconfig.json` cause compile errors.
585+
586+
```json
587+
{
588+
"compilerOptions": {
589+
"moduleResolution": "node" // incorrect
590+
}
591+
}
592+
```
593+
594+
```console
595+
$ npx tsc --noEmit
596+
__generated__/1-basic/fabbrica.ts:7:8 - error TS2307: Cannot find module '@mizdra/graphql-fabbrica/helper' or its corresponding type declarations.
597+
598+
7 } from '@mizdra/graphql-fabbrica/helper';
599+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
600+
```
601+
602+
To resolve this error, set the value of `moduleResolution` to `Bundler`, `Node16` or `NodeNext`.
603+
604+
```json
605+
{
606+
"compilerOptions": {
607+
"moduleResolution": "Bundler" // ok
608+
}
609+
}
610+
```
611+
582612
## License
583613

584614
This library is licensed under the MIT license.

0 commit comments

Comments
 (0)