T Indie
06/18/2022, 12:41 PMError: Command failed with exit code 1: ./node_modules/.bin/next build
Failed to compile.
./next.config.js:1:27
Type error: Rest parameter 'args' implicitly has an 'any[]' type.
> 1 | module.exports = function(...args) {
| ^
2 | let original = require('./next.config.original.1655555811863.js');
3 | const finalConfig = {};
4 | const target = { target: 'serverless' };
info - Using webpack 5. Reason: Enabled by default <https://nextjs.org/docs/messages/webpack5>
info - Checking validity of types...
at makeError (/Users/user/serveless-stack/node_modules/execa/lib/error.js:60:11)
at handlePromise (/Users/user/serveless-stack/node_modules/execa/index.js:118:26)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Builder.build (/Users/user/serveless-stack/node_modules/@sls-next/lambda-at-edge/dist/build.js:377:13) {
shortMessage: 'Command failed with exit code 1: ./node_modules/.bin/next build',
command: './node_modules/.bin/next build',
escapedCommand: '"./node_modules/.bin/next" build',
exitCode: 1,
signal: undefined,
signalDescription: undefined,
stdout: 'info - Using webpack 5. Reason: Enabled by default <https://nextjs.org/docs/messages/webpack5>\n' +
according to https://github.com/aws-amplify/amplify-hosting/issues/2427 the { target: ‘serverless’ }; is no longer supported by it gets inserted automatically by the sst stackDerek Kershner
06/18/2022, 4:31 PMnext.config.js
file is the culprit, though, what do you have in there?Derek Kershner
06/18/2022, 4:33 PMDerek Kershner
06/18/2022, 4:34 PMT Indie
06/19/2022, 11:48 AM// @ts-ignore
// eslint-disable-next-line @typescript-eslint/no-var-requires
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env["ANALYZE"] === "true",
});
// eslint-disable-next-line @typescript-eslint/no-var-requires
const withTM = require("next-transpile-modules")([
"@fullcalendar/common",
"@fullcalendar/daygrid",
"@fullcalendar/interaction",
"@fullcalendar/list",
"@fullcalendar/react",
"@fullcalendar/timegrid",
"@fullcalendar/timeline",
]);
/**
* @type {import('next').NextConfig}
**/
module.exports = withTM(
withBundleAnalyzer({
reactStrictMode: true,
images: {
domains: ["<http://assets.s3.amazonaws.com|assets.s3.amazonaws.com>"],
},
}),
);T Indie
06/19/2022, 11:48 AM{
"compilerOptions": {
...
"checkJs": false
...
}
}
Derek Kershner
06/19/2022, 3:12 PMDerek Kershner
06/19/2022, 3:13 PMT Indie
06/20/2022, 12:28 PM"exclude": ["node_modules", "./next", "next.config.js"]