Skip to content

custom view path not honored when using denjucks template engine #294

@peanutbother

Description

@peanutbother

[Details]
Mandarine seems to ignore view path setting when configured for denjucks.

[Stacktrace]

error: Uncaught MandarineException: The template ./src/main/resources/templates/index.html could not be initialized. This may be caused because the path is incorrect.
                    throw new MandarineException(MandarineException.INVALID_TEMPLATE.replace("%templatePath%", fullPath));
                          ^
    at MandarineTemplateManager.register (https://deno.land/x/mandarinets@v2.3.2/main-core/templates-registry/templatesRegistry.ts:39:27)
    at https://deno.land/x/mandarinets@v2.3.2/main-core/templates-registry/templatesRegistry.ts:83:75
    at Array.forEach (<anonymous>)
    at https://deno.land/x/mandarinets@v2.3.2/main-core/templates-registry/templatesRegistry.ts:81:38
    at Array.forEach (<anonymous>)
    at https://deno.land/x/mandarinets@v2.3.2/main-core/templates-registry/templatesRegistry.ts:76:65
    at Array.forEach (<anonymous>)
    at MandarineTemplateManager.initializeTemplates (https://deno.land/x/mandarinets@v2.3.2/main-core/templates-registry/templatesRegistry.ts:74:10)
    at MandarineCore.initializeTemplates (https://deno.land/x/mandarinets@v2.3.2/main-core/mandarineCore.ts:56:63)
    at new MandarineCore (https://deno.land/x/mandarinets@v2.3.2/main-core/mandarineCore.ts:32:14)

[Scenario]
Steps to reproduce the behavior:

  1. set templateEngine > "path":"[custom path]" and set template > "engine": "denjucks" in properties.json
  2. create controller with attached view ( @Render('view path') )
  3. start mvc

[Minimal Repro]
https://gist.github.com/peanutbother/263a01f90374e6d230931f83518047ab

[Expected behavior]
Rendering should work as expected.

[Screenshots]
image

[OS]
Windows 10 Professional 20H2 (Build 19042.985)

[Environment]

  • Mandarine version: v2.3.2
  • Deno version: 1.10.1
  • Deno v8 version: 9.1.269.27
  • Deno typescript version: 4.2.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions