I have a minimal app that runs fine locally using express, but when built using netlify-lambda throws some errors related to strict mode:
ERROR in ../compiledRender/views/hello.js
Module build failed (from /netlify-test/node_modules/babel-loader/lib/index.js):
SyntaxError: /netlify-test/lib/compiledRender/views/hello.js: 'with' in strict mode (50:2)
48 | var __output = "";
49 | function __append(s) { if (s !== undefined && s !== null) __output += s }
> 50 | with (locals || {}) {
| ^
51 | ; __append("<h1>")
52 | ; __append( include('includes/greeting') )
53 | ; __append(" from Express.js!</h1>\n")
This is the repo:
It’s choking on the compiled ejs template. Is there a way to turn off strict mode either globally or for specific files in netlify-lambda build?