"Couldn't find a template file for that component type."

I'm having trouble setting up a custom component template using Sapphire CLI. Here's the template file (custom-listener.ts.sapphire):
{
"category": "listeners"
}
---
export class {{name}}Listener extends Listener {
public constructor(context: Listener.LoaderContext, options: Listener.Options) {
super(context, {
...options,
/**
* These two default to the file's name.
*/
name: 'ready',
event: 'ready'
/** */
});
}

/**
* Executes on event trigger
* @param client - The client that triggered this event
*/
public run(client: Client) {
// TODO
}
}
{
"category": "listeners"
}
---
export class {{name}}Listener extends Listener {
public constructor(context: Listener.LoaderContext, options: Listener.Options) {
super(context, {
...options,
/**
* These two default to the file's name.
*/
name: 'ready',
event: 'ready'
/** */
});
}

/**
* Executes on event trigger
* @param client - The client that triggered this event
*/
public run(client: Client) {
// TODO
}
}
When running npx sapphire generate custom-listener test it returns Couldn't find a template file for that component type. Default component templates work normally
Solution:
Solved by moving my custom templates folder to the root directory instead of inside src
Jump to solution
1 Reply
Solution
Teixeira
Teixeira13mo ago
Solved by moving my custom templates folder to the root directory instead of inside src
Want results from more Discord servers?
Add your server