Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: cannot use absolut path in layout-option of response.render #113

Closed
Tineler opened this issue Mar 9, 2015 · 2 comments · Fixed by #114 · 4 remaining pull requests
Closed

Windows: cannot use absolut path in layout-option of response.render #113

Tineler opened this issue Mar 9, 2015 · 2 comments · Fixed by #114 · 4 remaining pull requests
Labels

Comments

@Tineler
Copy link
Contributor

Tineler commented Mar 9, 2015

Following call:

   router.get('/hello', function(req, res) {
       res.render(__dirname + '/views/home.handlebars', {
           layout: __dirname + '/views/layouts/main.handlebars',
           markup: markup // Pass rendered react markup
       });
    });

leads to following error message:
Error: ENOENT, open D:\ZHAW\BA\IoT_Base\lib\views\layouts\D:\ZHAW\BA\IoT_Base\lib\plugins\IoT_HelloWorld\views\layouts\main.handlebars'

Seems to me, as if the path is handled relative even though it's obviously absolute.

@ericf
Copy link
Owner

ericf commented Mar 9, 2015

@Tineler Yeah, this would need to change so that it works with Windows paths and not just Unix-style ones: https://github.com/ericf/express-handlebars/blob/master/lib/express-handlebars.js#L331-333

@ericf ericf added the bug label Mar 9, 2015
@Tineler
Copy link
Contributor Author

Tineler commented Mar 9, 2015

Seems legit. Do you mind if I fork the repo and create a pull-request after fixing it? Because I need it pretty soon. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment