Skip to content

Bug: Running the scaffold command while Jinja is installed throws an exception and aborts halfway #79

@DamnedScholar

Description

@DamnedScholar

Bug Report

Describe the bug

When you run generate_reflex, the boilerplate template gets run through the Django template engine in order to create an appropriately named generic html file. If you have disabled the default Django templating in favor of Jinja, it will throw a syntax exception and catch fire, but not before the reflexes directory is created. The templates and javascript directories get blocked completely.

https://puu.sh/H7yV2/8c3a713720.png

Expected behavior

  1. If one part of the scaffold pipeline isn't supported (an exception is thrown), all changes should be rolled back or not started to begin with. Perhaps the management command could queue processed template strings and then write them to files after it has iterated through the input list without error.
  2. The package should emit an error message indicating that the management command has failed and which dependency was missing.

Thoughts

Obviously the solution to my problem is to override the templates with proper Jinja syntax, which I am doing. That will nullify the errors encountered above, but won't fix the hole in the pipeline, so I will also look into patching the management command. There will definitely be a graceful shutdown with informative error message in the case of this particular problem, and I will likely submit a follow-on PR with a Jinja-compatible template set and backend autodetection.

Very low priority. If you're doing advanced enough shit to run into this, you're going to be able to work around it like I am.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions