Skip to main content

Troubleshooting

What you see, why, and what to do, in the order you meet it. Most settings that "do nothing" are a spelling mistake, because CodeBaker ignores a key it does not know. Known Limitations lists the things that are by design.


The menu and the dialog​

The template is not in New → Generate from Template. Right-click a folder in the Project view. A template whose config has paths is offered only in the folders that match, and a pattern CodeBaker cannot read leaves the template out, with a warning balloon: paths. The template must be in the .CodeBaker/ folder at the project root.

A setting seems to do nothing. A key CodeBaker does not know is ignored, with no message. Compare the spelling with Keys at a glance: placeholder is not placeholders.

There is no field in the dialog for my list. vars takes text only: an array or an object there is dropped without a message. Put lists in the json section.

Invalid JSON: ... under the JSON area, and Next is disabled. The JSON area is JSON5 and has to parse (after its {{ }} are filled in). Fix the text it names.

The config is refused before the dialog opens. It is the syntax setting: the message lists every problem with it.


Step 2: Pre-Generation​

Some files cannot be written, and nothing has been written yet. A folder is not writable, or a file that would change is read-only. Make them writable, or leave the files out with false in the mapping. Step 2.

The target path "..." is not allowed. A target has .., a backslash or a control character in a name. Use a plain path: Security.

The target path "..." cannot be created on Windows. On Windows, a file or folder name cannot contain < > : " | ? *, cannot end with a space or a dot, and cannot be CON, PRN, AUX, NUL, COM1 to COM9 or LPT1 to LPT9 (with any extension). The message names the part that is wrong. It often comes from a value typed in the form that is used in a file name (Q1: plan in {{ title }}.txt): change the value, or change the name in the template. Nothing has been written. On macOS and Linux these names are accepted, so a template made there may still fail for a teammate on Windows.

The range 1..N would hold ... numbers in memory or The template produced more than ... million characters. A loop is far bigger than any file needs. Use a smaller range, or loop over a list: Known Limitations.

The pattern of a regex rule is not valid. Check the pattern after CodeBaker: regex: Replacing Real Values.

Unknown "format": ... format takes "json", false or "json5": Generating JSON.

A Pebble error that quotes the first 500 characters of the content. Pebble could not read the file. The usual causes are a literal {{ }} or {% %} in a comment (Escaping Text), a tag that is not closed, or a tag that loads another template (Known Limitations).

Only http and https addresses can be fetched, or API request failed with status code .... An $api address is wrong, not public or not answering within 5 seconds: Data Sources.

json-upsert into <file>: ... The target cannot be updated without throwing data away: the message says why (no path, a step of the path is not an object, the target is not valid JSON5, an unknown position): JSON Upsert.

Insert into <file>: the slot "..." was not found (or a slot that is not closed, nested or declared twice). Nothing was inserted and the file is unchanged. Check the slot markers in the target: Seed, Insert and Replace.


What the files look like​

A file I expected was copied under its own name. An if in the mapping file without an else leaves the entry out, and a file that is not listed is copied as it is. Add the else with false: Loops and Conditions in the Mapping File.

The text I typed into a slot is gone. An insert goes into the generated result, so a file written again from its template starts from the template's slot. Make the file a seed: Questions and Answers.

A placeholder came out empty. A name that is not a variable renders as empty text, which also hides a typo. Compare it with the names in vars, the json area and the system properties.

A directive, or some text after it, is missing or shows up in the file. It has to be the last thing on its line, start with CodeBaker:, and not begin with a reserved word by accident: Directive Reference.

$file gave an empty list. A missing, blank or unparseable file gives [] with at most a warning. Check the path and the prefix (target://, template://, project://), and that the file is inside its folder: Data Sources.


Step 4 and after​

Failed to generate template: ... Writing failed part way. The files written before the error stay, and Edit → Undo reverts them (not binary files: use Git). Step 4.

The Undo of a generation is not available. A generation that only wrote files the IDE does not track as text, such as an image, cannot be undone from the IDE: use Git.


Installing a template​

The messages of Install Template from URL and what to do about each are in the Installing Templates table. Only public links can be installed.