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.

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay