Skip to content

server error render throws error with EJS #681

@sullivanpt

Description

@sullivanpt

The Express render callback html argument is being ignored. It looks like somebody tried to hack a fix by calling render a second time, but the correct thing to do with a callback is to send the html. Otherwise you have to specify the scope twice.

Thus this should be written as: https://github.com/DaftMonk/generator-angular-fullstack/blob/canary/app/templates/server/components/errors/index.js

  res.render(viewFilePath, { }, function (err, html) {
    if (err) { return res.json(result, result.status); }

    res.send(html);
  });

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions