Skip to content

Cryptic error message #35

@gtsiam

Description

@gtsiam

Setting up a simple example project:

//...

app.set('view engine', 'ejs');
app.set('views', __dirname + '/views');
app.set('layout', __dirname + '/views/layouts/default.ejs');
app.set('layout extractScript', true);
app.set('layout extractStyles', true);

//...

When rendering a simple page, I was getting 'script' is not defined (Referring to <%- script %> in the layout file)

I found that the issue was that I set 'extractScript', and not 'extractScripts', but the error message is very cryptic for newcomers. Shouldn't it be something like:

"you need to set 'layout extractScripts' to true before using <%- script %>"

Not critical by any means, but it took me a while to find the typo. It would be nice to get that half an hour of my life back.

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