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

Cryptic error message #35

Open
gtsiam opened this issue Jan 2, 2018 · 0 comments
Open

Cryptic error message #35

gtsiam opened this issue Jan 2, 2018 · 0 comments

Comments

@gtsiam
Copy link

gtsiam commented Jan 2, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant