-
Notifications
You must be signed in to change notification settings - Fork 120
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
Angular 8 universal not working gives an error strict mode code may not contain 'with' statements #170
Comments
any updates , i faced this issue |
Nope, I tried everything but cant find any solution. So finally I migrate my whole project into nextjs |
ummm okay thanks |
Depending on your use case you can use patch-package to remove the non-compliant code. I'm using domino as a dependancy of turndown and as far as I can tell sloppy.js isn't needed in my case. I created the patch file: diff --git a/node_modules/domino/lib/sloppy.js b/node_modules/domino/lib/sloppy.js
which I deploy to the server by adding as a package.json script. This solved the problem for me. |
This error comes to me via usage of Angular Universal. When attempting to serve my development server and accessing any of the pages, I am greeted to a blank screen and this error in the console:
SyntaxError: strict mode code may not contain 'with' statements
specifically pointing to this line as the issue: './node_modules/domino/lib/sloppy.js'
module.exports = { Window_run: function _run(code, file) { if (file) code += '\n//@ sourceURL=' + file; with(this) eval(code); ==>>>showing error }, EventHandlerBuilder_build: function build() { try { with(this.document.defaultView || Object.create(null)) with(this.document) with(this.form) with(this.element) return eval("(function(event){" + this.body + "})"); } catch (err) { return function() { throw err; }; } } };
The text was updated successfully, but these errors were encountered: