Open shenburak opened 5 years ago
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!
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 - https://github.com/zeit/next.js/pull/8432
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: https://github.com/cyrilwanner/next-compose-plugins/blob/d81db51821f92a8872930ed630eb064e3fb82e04/src/index.js#L11-L14
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.
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.
The project is working fine I only get the following warning when I add next-compose-plugins