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

Incomplete and unclear documentation on how to get rid of target: serverless on next config js #30822

Closed
charly714 opened this issue Nov 2, 2021 · 7 comments · Fixed by #32255
Assignees
Labels
Output (export/standalone) Related to the the output option in `next.config.js`.

Comments

@charly714
Copy link

What version of Next.js are you using?

12.0.2

What version of Node.js are you using?

14.17.6

What browser are you using?

Chrome

What operating system are you using?

MacOs

How are you deploying your application?

Serverless

Describe the Bug

Hello,
I updated to next js v12 today, and after reading the breaking changes in the blog I saw that the option target: serverless on the next.config.js file is going to be deprecated in a future version. (In the blog is written as a breaking change, as if it will make the app not work from this recently released version, which doesn't seem to be the case).
There is a link to explain how to "possibly" solve it, but the documentation is extremely poor. It generates us more questions than answers.
I open this issue as a bug, because to have good documentation should be part of such a major release.

Expected Behavior

It would be really nice to have a more extended and detailed documentation, including code samples.
Having a guide for specific for when using Serverless would be amazing.

To Reproduce

Visit https://nextjs.org/docs/advanced-features/output-file-tracing

@charly714 charly714 added the bug Issue was opened via the bug report template. label Nov 2, 2021
@benhorst
Copy link

benhorst commented Nov 3, 2021

I'm in the same place. We're using AWS Lambda (biz req at this time, sadly) with target="serverless" and a bit of a slapped together implementation of ncc to get things working (which I think is also sub-optimal).

In order to upgrade, we'll need to be able to leverage file tracing.
We are also very motivated to reduce the load of node_modules and excited by the tracing potential here!

A code sample a la create-next-app with-nft-build would be fantastic. Is there anything we can do to help?

@ijjk ijjk added type: documentation Output (export/standalone) Related to the the output option in `next.config.js`. and removed bug Issue was opened via the bug report template. labels Nov 4, 2021
@ijjk ijjk self-assigned this Nov 4, 2021
@benhorst
Copy link

benhorst commented Nov 8, 2021

@ijjk is there anything I can do for you to help with use case?

@ijjk
Copy link
Member

ijjk commented Nov 8, 2021

Hi, there is an active PR here which expands the tooling around leveraging these traces and expanded documentation/examples will follow as well.

@HectorLS
Copy link

Hello @charly714
by now i just removed the key target: 'serverles' and the deprecated flag obviously dissapear and everything is working as expected, but i have still no try any deploy on production to Vercel in my case. Do you ?

@ijjk
Copy link
Member

ijjk commented Nov 10, 2021

@HectorLS no additional steps are needed when deploying on Vercel as we already leverage the new output file traces mentioned and ensure the correct target is set.

@kodiakhq kodiakhq bot closed this as completed in #32255 Dec 7, 2021
kodiakhq bot pushed a commit that referenced this issue Dec 7, 2021
This adds documentation to explain how the `outputStandalone` config can be leveraged to reduce production deployment size and leverage the output file traces.  This also adds a note for the `outputFileTracingRoot` config as it may be needed in some monorepo setups. 

A follow-up PR will update our Docker example to leverage this config as well. 

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`

x-ref: #31003
x-ref: #32252
Closes: #30822
@benhorst
Copy link

benhorst commented Dec 7, 2021

Thanks, @ijjk! I've posted the PR and new docs for my team to take a look at. We'll follow up if we have additional questions. Appreciate your work on this :)

kodiakhq bot pushed a commit that referenced this issue Dec 13, 2021
This updates our docker example to leverage the output traces and standalone build to reduce the resulting docker image quite a bit. 

docker image size before: `272MB`
docker image size after: `121MB`
node-14:alpine size (base image): `118MB`

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`

x-ref: #32255
x-ref: #32252
x-ref: #30822
cdierkens pushed a commit to cdierkens/next.js that referenced this issue Dec 20, 2021
This updates our docker example to leverage the output traces and standalone build to reduce the resulting docker image quite a bit. 

docker image size before: `272MB`
docker image size after: `121MB`
node-14:alpine size (base image): `118MB`

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`

x-ref: vercel#32255
x-ref: vercel#32252
x-ref: vercel#30822
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
natew pushed a commit to natew/next.js that referenced this issue Feb 16, 2022
This adds documentation to explain how the `outputStandalone` config can be leveraged to reduce production deployment size and leverage the output file traces.  This also adds a note for the `outputFileTracingRoot` config as it may be needed in some monorepo setups. 

A follow-up PR will update our Docker example to leverage this config as well. 

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`

x-ref: vercel#31003
x-ref: vercel#32252
Closes: vercel#30822
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Output (export/standalone) Related to the the output option in `next.config.js`.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants