A generator has a mistake
error: generator component has a mistake in files/{{ kebab(name) }}.tsx: line 3: the generator has no variable named nmaehint: Fix the generator, then run axle generate again.Why it happens
Section titled “Why it happens”A generator that axle generate ran or listed can’t be used as it is. The message names the file and says what’s wrong, such as:
generator.tomlcan’t be read, has a key Axle doesn’t know, or a variable whosepatternisn’t a valid regular expression or whosechoicesisn’t a list or"packages";- the folder has neither a
filesfolder nor agenerator.ts, or more than one of them; - a template uses a variable the generator doesn’t have, or a filter that doesn’t exist;
- two templates would be written to the same file;
[generators]inaxle.tomlnames a generatorpackageorci, which are built in, or uses a:, which is kept for plugins’ generators.
The same error, with “would write …, which is outside the repository, in .git, or has a name Windows keeps for itself”, means a file would land outside the repository or in .git, because of the generator’s destination, --folder, or a value such as ../.. in a variable. It’s also refused when a part of its path is a name Windows reads as something else, such as aux, con or com1, a short name such as GIT~1, or a name ending in a dot or a space, so a repository works the same on every system.
How to fix it
Section titled “How to fix it”Fix the file and line it names; writing generators lists what a generator may hold. For a generator a plugin ships, update the plugin or tell its authors. Nothing was written.