SyntaxError: Strict mode does not allow function declarations in a lexically nested statement in IOS 9.x.
Steps to reproduce the behavior, please provide code snippets or a repository:
page should work.


@yanghuabei some problem with you,8.0.3 is well
Also in IE10
It also happens to me in 2 different applications using [email protected]. Had to downgrade them to make it work.
It also happens to me
I can confirm that this is fixed in the latest, 8.1.1-canary.28, and probably since canary 20.
As @fionawhim mentioned, this was fixed when we made async-to-promises experimental and is no longer enabled by default. I'm going to close this now, if you are still having trouble with this on the latest canary please reply with additional details.
This is actually _not_ caused by async-to-promises. It's caused by Terser defaulting to the inline=3 setting, which is inlining functions where it is unsafe to do so. It can also cause performance issues.
@ijjk Is there any backport of this fix (or another way to enable it) on the stable 8.1.0 branch? We're seeing lots of this in production logs.
This will be fixed by https://github.com/zeit/next.js/pull/7554.
Published as 8.1.1-canary.51. 🙏
after updating to 8.1.1 - canary custom ts-node (from examples folder) config went down. "Next.js now provides ts support from scratch"... How to run own custom server with typescript now?
emmm, I think it is no related to terser.
In v8.1.0, I can fixed it by adding
if (!isServer) {
// console.log(JSON.stringify(config));
config.module.rules.push({
test: /\.(tsx|ts|js|mjs|jsx)$/,
include: [
/next-server[\\/]dist[\\/]lib/,
/next[\\/]dist[\\/]client/,
/next[\\/]dist[\\/]pages/,
/[\\/](strip-ansi|ansi-regex)[\\/]/,
],
exclude: path => {
if (
/next-server[\\/]dist[\\/]lib/.test(path) ||
/next[\\/]dist[\\/]client/.test(path) ||
/next[\\/]dist[\\/]pages/.test(path) ||
/[\\/](strip-ansi|ansi-regex)[\\/]/.test(path)
) {
return false;
}
return /node_modules/.test(path);
},
use: defaultLoaders.babel,
});
}
to file next.config.js after review the code of #7014
Most helpful comment
It also happens to me in 2 different applications using [email protected]. Had to downgrade them to make it work.