dennisreimann / uiengine

Workbench for UI-driven development
https://uiengine.uix.space/
MIT License
366 stars 25 forks source link

Replace variantId inside the variant render error message #26

Closed JonasHavers closed 6 years ago

JonasHavers commented 6 years ago

Describe the bug The variant id inside the variant render error message is misleading (for me).

File: src/components/Footer/variants/footer-vue-sfc.vhtml

Example Error:

Variant "Footer/footer-vue-sfc.vhtml-1" could not be rendered!

When I read the message, I thought the UIengine created a wrong file path (including the "-1" suffix) and did not find the file (due to a missing configuration or sth like that).

Also the debug option did not provide any details for me. Am I missing something in the config?

        vhtml: {
            module: '@uiengine/adapter-vue',
            options: {
                debug: true,
                bundle: '...bundle...'
            }
        }

Expected behavior The variant id is an internal (undocumented) UIengine detail. The cause for the error is not clear (missing file, wrong file name, render error etc.) for the user and the variant id inside the message is misleading.

Besides more details, I'd expect to be given the variant file's path relative to the project or to the component in the error message.

dennisreimann commented 6 years ago

Thanks, will be fixed with the upcoming release :)

dennisreimann commented 6 years ago

The error reports a message like this now:

Error: Variant "Form" could not be rendered!

Component: form
File: src/components/form/variants/form.pug

Unexpected token (80:0)
dennisreimann commented 6 years ago

Released v1.0.7 – thanks for the detailed issue report!