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

Found experimental config #21

Open
shenburak opened this issue Aug 11, 2019 · 4 comments
Open

Found experimental config #21

shenburak opened this issue Aug 11, 2019 · 4 comments

Comments

@shenburak
Copy link

The project is working fine I only get the following warning when I add next-compose-plugins

Found experimental config:
Experimental features can change at anytime and aren't officially supported (use at your own risk).

@cyrilwanner
Copy link
Owner

I tried it in a new project with the current next.js version and can not see this output. Can you post your next.config.js file (maybe it is coming from another plugin) and tell which next.js version you are using? Thanks!

@stoberov
Copy link

stoberov commented Sep 3, 2019

I too was noticing this warning with Next 9.0.3.
As per @cyrilwanner 's comment from yesterday, I updated to the latest Next 9.0.5 - and the warning is gone :)

I'm thinking this was related to one of Next's recent patches in 9.0.5 - vercel/next.js#8432

@jnv
Copy link

jnv commented Dec 28, 2020

It looks like the issue still happens with Next.js 10. I am looking into it in relation with the next-img's issue mentioned above.

Basically withPlugins returns a function which is detected by Next and triggered here: https://github.com/vercel/next.js/blob/118588b027ec33af0935fec481d6155fa593d257/packages/next/next-server/server/config.ts#L462-L473

Note the line 464:

config = config(phase, { defaultConfig })

This means the function created by withPlugins (here named config) receives the defaultConfig from Next which it dutifully merges with the user's custom config:

const config = {
...defaultConfig,
...nextConfig,
};

This means the experimental property is passed by Next itself from the defaultConfig, therefore it triggers the experimental warning. Although I thought that the reference to the experimental object should remain untouched, which would be caught by this condition – but apparently that's not the case.

I will put together a minimal example with fresh dependencies.

@jnv
Copy link

jnv commented Dec 28, 2020

Okay, looks like the issue is rather specific to the next-img plugin, since it uses deepmerge to generate resulting configuration object. Deepmerge by default creates a deep clone of objects instead of copying the reference, therefore the reference to the original experimental object is lost. I suggest this issue can be closed, since the Next's check by reference should be sufficient for majority use cases.

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

4 participants