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

Doesn't correctly handle NextJS config function #1040

Closed
1 task
sambauers opened this issue May 23, 2024 · 3 comments
Closed
1 task

Doesn't correctly handle NextJS config function #1040

sambauers opened this issue May 23, 2024 · 3 comments

Comments

@sambauers
Copy link

sambauers commented May 23, 2024

What version of million are you using?

1.0.0-rc.1

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

pnpm

What operating system are you using?

Mac

What browser are you using?

Safari

Describe the Bug

My NextJS config is setup as a function, as outlined here - https://nextjs.org/docs/app/api-reference/next-config-js

E.g.:

const MillionLint = require('@million/lint')

const nextConfig = async (phase, { defaultConfig }) => {
  const config = {
    /* config options here */
  }
  return config
}

module.exports = MillionLint.next({ rsc: true })(nextConfig)

Looking at the source of Million, it appears that this is not a supported configuration option.

What's the expected result?

I expected Million to accept the configuration.

Link to Minimal Reproducible Example

http://example.com

Participation

  • I am willing to submit a pull request for this issue.
Copy link

Thanks for opening this issue! A maintainer will review it soon.

@sambauers
Copy link
Author

I quickly realised the workaround. Simply wrap the return for the function instead. E.g.:

const MillionLint = require('@million/lint')

const nextConfig = async (phase, { defaultConfig }) => {
  const config = {
    /* config options here */
  }
  return MillionLint.next({ rsc: true })(config)
}

module.exports = nextConfig

It would be good to document this.

@johnjyang
Copy link
Collaborator

Noted. Thanks for providing the snippet!

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

No branches or pull requests

2 participants