Closed orafaelfragoso closed 4 years ago
Sorry for the late reply. Next.js should load the config, even when using a custom server. If that is not the case, please try updating next.js or open an issue in their reposiroty.
Next.js should load the config, even when using a custom server. If that is not the case, please try updating next.js or open an issue in their reposiroty.
Not clear from your answer what is the solution.
Yes, next.js does try to load next.config.js
even when using custom server.
However, we want pass config using next.js server conf
parameter (https://nextjs.org/docs/advanced-features/custom-server).
@orafaelfragoso Just gave up on this issue, so not helpful.
I'm having trouble loading my configuration on my custom server. This is the setup I'm using:
next.config.js
server.js
And this is the error I'm getting:
The question here is: How can I make this configuration load on the server properly? NextJS is not reading the config file by default and I cannot load it manually.
I was able to make it work by importing the
next.config.js
object directly, outside thewithPlugins
function, but this is not what I want, since all the plugins won't be loaded this way.Please, help!