Next.js Discord

Discord Forum

With statement are not allowed in strict mode

Unanswered
style posted this in #help-forum
Open in Discord
Hey im having problem with building my app - and im wondering if it will work on vercel if it doesn't build on my local pc in that case

I:\wryter.io>yarn build
yarn run v1.22.18
$ next build
- info Loaded env from I:\wryter.io\.env.local
- warn You have enabled experimental feature (serverActions) in next.config.js.
- warn Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk.

Failed to compile.

./node_modules/domino/lib/sloppy.js
Error:
  × With statement are not allowed in strict mode
    ╭─[I:\wryter.io\node_modules\domino\lib\sloppy.js:7:1]
  7 │ module.exports = {
  8 │   Window_run: function _run(code, file) {
  9 │     if (file) code += '\n//@ sourceURL=' + file;
 10 │     with(this) eval(code);
    ·     ────
 11 │   },
 12 │   EventHandlerBuilder_build: function build() {
 13 │     try {
    ╰────
.
.
.

  × With statement are not allowed in strict mode
    ╭─[I:\wryter.io\node_modules\domino\lib\sloppy.js:14:1]
 14 │       with(this.document.defaultView || Object.create(null))
 15 │         with(this.document)
 16 │           with(this.form)
 17 │             with(this.element)
    ·             ────
 18 │               return eval("(function(event){" + this.body + "})");
 19 │     }
 20 │     catch (err) {
    ╰────

Caused by:
    Syntax Error

Import trace for requested module:
./node_modules/domino/lib/sloppy.js
./node_modules/domino/lib/Window.js
./node_modules/domino/lib/index.js
./node_modules/turndown/lib/turndown.cjs.js
./src/lib/helpers.ts
./src/app/api/create-portal-link/route.ts


> Build failed because of webpack errors
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I got no idea whats that package

0 Replies