DEV Community

Oliver Westbury
Oliver Westbury

Posted on

Upgrade Next 12 to 13 - Github build Deploy Next.js app - The root value has an unexpected property, target,

Github build failed: -
name: Deploy Next.js app
run: npx serverless@2.72.2

aNA error: Error: Command failed with exit code 1: node_modules/.bin/next build warn - Invalid next.config.js options detected:

The root value has an unexpected property, target, which is not in the list of allowed properties (amp, analyticsId, assetPrefix, basePath, cleanDistDir, compiler, compress, crossOrigin, devIndicators, distDir, env, eslint, excludeDefaultMomentLocales, experimental, exportPathMap, generateBuildId, generateEtags, headers, httpAgentOptions, i18n, images, modularizeImports, onDemandEntries, optimizeFonts, output, outputFileTracing, pageExtensions, poweredByHeader, productionBrowserSourceMaps, publicRuntimeConfig, reactStrictMode, redirects, rewrites, sassOptions, serverRuntimeConfig, skipMiddlewareUrlNormalize, skipTrailingSlashRedirect, staticPageGenerationTimeout, swcMinify, trailingSlash, transpilePackages, typescript, useFileSystemPublicRoutes, webpack).

/** @type {import('next').NextConfig} */
const headers = async () => {
    return [
        {
            source: '/:path*',
            headers: [
                {
                    key: 'X-Content-Type-Options',
                    value: 'nosniff'
                },
                {
                    key: 'X-Frame-Options',
                    value: 'SAMEORIGIN'
                },

            ]
        }
    ]

}
const nextConfig = {
reactStrictMode: true,
output: 'standalone',
transpilePackages: \['@ionic/react', '@ionic/core', '@stencil/core', 'ionicons'\],
async redirects() {
return \[
 {
    source: '/',
    destination: '/language',
    permanent: true
 }
\]
},
headers,
  images: {
    domains: \['media.graphcms.com', 'res.cloudinary.com', 
   'images.unsplash.com', 'media.graphassets.com'\],
  unoptimized: true,
}
};
module.exports = nextConfig;
Enter fullscreen mode Exit fullscreen mode

Can anyone advice how to resolve this issue next 13? trying to fix/rewrite all day and no luck... cant find Target in anything. In case, local terminal: npm run build is passed.

Thank you in advance.

Top comments (0)