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

[DOCS] async withContentCollections #391

Open
mxkaske opened this issue Nov 5, 2024 · 2 comments
Open

[DOCS] async withContentCollections #391

mxkaske opened this issue Nov 5, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@mxkaske
Copy link

mxkaske commented Nov 5, 2024

This is more informational! Thanks for that awesome library!

We faced an issue within next.config.js that was not mentioned in the docs so far: the withContentCollections returns a promise and therefore needs to be awaited in some cases (e.g. when using multiple config extensions).

// next.config.js
module.exports = withSentryConfig(async () => await withContentCollections(nextConfig), { ... });

vs.

// next.config.js
module.exports = withContentCollections(withSentryConfig(nextConfig, { ... }));

The referenced change for OpenStatus: https://github.com/openstatusHQ/openstatus/pull/1084/files#diff-a5de0fa0d80f14a44e9bdf2ed5d0cbb3a7bd5fdcacfbc1d03b5dcb57fc4943c1R59

Nextjs docs: https://nextjs.org/docs/messages/promise-in-next-config

@sdorra sdorra added the documentation Improvements or additions to documentation label Nov 5, 2024
@sdorra
Copy link
Owner

sdorra commented Nov 5, 2024

That is the reason why the documentation mentions that content collections must be the outermost plugin: Next adapter documentation.

Perhaps we could explain more about why it should be the outermost plugin.

@mxkaske
Copy link
Author

mxkaske commented Nov 5, 2024

Oh well, my bad, can’t read.

And if two plugins claim to be the outermost plugin, you can still await it. :)

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

No branches or pull requests

2 participants