File tree 3 files changed +7
-2
lines changed
packages/graphql-codegen-cli/src
3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @graphql-codegen/cli ' : patch
3
+ ---
4
+
5
+ Fix wrong MODULE_NOT_FOUND for missing dependencies
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ export async function getPluginByName(
22
22
try {
23
23
return await pluginLoader ( moduleName ) ;
24
24
} catch ( err ) {
25
- if ( err . code !== 'MODULE_NOT_FOUND' ) {
25
+ if ( err . code !== 'MODULE_NOT_FOUND' || ! err . message . includes ( moduleName ) ) {
26
26
throw new DetailedError (
27
27
`Unable to load template plugin matching ${ name } ` ,
28
28
`
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ export async function getPresetByName(
18
18
19
19
return loaded as Types . OutputPreset ;
20
20
} catch ( err ) {
21
- if ( err . code !== 'MODULE_NOT_FOUND' ) {
21
+ if ( err . code !== 'MODULE_NOT_FOUND' || ! err . message . includes ( moduleName ) ) {
22
22
throw new DetailedError (
23
23
`Unable to load preset matching ${ name } ` ,
24
24
`
You can’t perform that action at this time.
0 commit comments