Closed mapeveri closed 2 years ago
Something in your codebase is invalid and throws an error when minified. Presumably the stack trace points you to more information about the error.
The reason it doesn't happen with ember build
is that we don't run minfication there by default.
Hi @rwjblue, I understand. And how could I detect the error in my code?. Thanks!!
We have switched from Uglify to Terser. Hopefully nowadays you get a better error message!
Just got this today after searching for a solution:
Build Error (TerserWriter)
'return' outside of function
Stack Trace and Error Report: /var/folders/g1/pkdwgwq57135gknzdvy_h0tr0000gn/T/error.dump.accae8da8d25920654632765fface5cd.log
"ember-auto-import": "^2.4.2",
"ember-cli": "~4.7.0",
"ember-cli-app-version": "^5.0.0",
"ember-cli-babel": "^7.26.11",
"ember-cli-code-coverage": "^1.0.3",
"ember-cli-dependency-checker": "^3.3.1",
"ember-cli-htmlbars": "^6.1.0",
"ember-cli-inject-live-reload": "^2.1.0",
"ember-cli-sass": "^11.0.1",
"ember-cli-sri": "^2.1.1",
"ember-cli-string-helpers": "^6.1.0",
"ember-cli-terser": "^4.0.2",
"ember-cli-typescript": "^5.1.1",
"ember-cli-typescript-blueprints": "^3.0.0",
return
outside of a function isn't valid javascript, so it's likely one of your libraries is causing will need to be updated, patched, or PR'd to.
After run
embe build --environment=production
i have this issue:With ember build, I do not have this problem.