Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(nextjs): Simplify NextConfigObject type #5514

Merged
merged 3 commits into from Aug 2, 2022

Conversation

lobsterkatie
Copy link
Member

@lobsterkatie lobsterkatie commented Aug 2, 2022

This simplifies the NextConfigObject type in the nextjs SDK, to enable future work. Key changes:

  • Removed index signature.
  • Added missing basePath and publicRuntimeConfig properties.
  • Made all properties optional. (This allowed for removal of the Partial annotation everywhere the type was used.)
  • Clarified variable names in config/index.ts to better reflect their types.

@lobsterkatie lobsterkatie enabled auto-merge (squash) August 2, 2022 18:57
@lobsterkatie lobsterkatie force-pushed the kmclb-nextjs-simplify-next-config-type branch from c9e2db7 to 63c76d0 Compare August 2, 2022 19:47
@lobsterkatie lobsterkatie merged commit 9b7131f into master Aug 2, 2022
@lobsterkatie lobsterkatie deleted the kmclb-nextjs-simplify-next-config-type branch August 2, 2022 22:45
@FranciscoKloganB
Copy link

FranciscoKloganB commented Aug 12, 2022

The removal of lines 21 through 23 breaks my build.

 & {
  // other `next.config.js` options
  [key: string]: unknown;
};
> tsc --project tsconfig.json

next.config.js:43:24 - error TS2345: 

    Argument of type 
        '{ 
            compiler: { styledComponents: boolean; };
            i18n: { locales: string[]; defaultLocale: string; localeDetection: boolean; };
            images: { domains: string[]; };
            reactStrictMode: boolean; 
            swcMinify: boolean; 
        }' 

is not assignable to parameter of type 'ExportedNextConfig | undefined'.

43  ? withSentryConfig(nextConfig, sentryWebpackPluginOptions)
                          ~~~~~~~~~~

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants