Skip to content

A generator has a mistake

error: generator component has a mistake in files/{{ kebab(name) }}.tsx: line 3: the generator has no variable named nmae
hint: Fix the generator, then run axle generate again.

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.toml can’t be read, has a key Axle doesn’t know, or a variable whose pattern isn’t a valid regular expression or whose choices isn’t a list or "packages";
  • the folder has neither a files folder nor a generator.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] in axle.toml names a generator package or ci, 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.

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.