File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
packages/commandkit/src/plugins/plugin-runtime Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 6
6
isCompilerPlugin ,
7
7
} from '..' ;
8
8
import { AsyncLocalStorage } from 'node:async_hooks' ;
9
+ import { Logger } from '../../logger/Logger' ;
9
10
10
11
/**
11
12
* Interface representing a template entry in the plugin runtime.
@@ -91,7 +92,7 @@ export class CompilerPluginRuntime {
91
92
}
92
93
93
94
/**
94
- * Unregisters a template handler for a given name.
95
+ * Unregister a template handler for a given name.
95
96
* This method must be called inside the deactivate() method of a plugin.
96
97
* @param name - The name of the template to unregister.
97
98
*/
@@ -153,6 +154,13 @@ export class CompilerPluginRuntime {
153
154
) : Promise < { code : string ; map : string | null } > {
154
155
let map : string | null = null ;
155
156
for ( const plugin of this . plugins ) {
157
+ if ( ! plugin ?. transform || typeof plugin ?. transform !== 'function' ) {
158
+ Logger . warn (
159
+ `Plugin ${ plugin ?. name ?? '<unknown>' } is invalid or does not have a transform method or the method is not a function` ,
160
+ ) ;
161
+ continue ;
162
+ }
163
+
156
164
try {
157
165
const res : MaybeFalsey < TransformedResult > = await plugin . transform ?.( {
158
166
code,
You can’t perform that action at this time.
0 commit comments