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

Bug:/Idea: npx next export is not supported anymore in Next.js #7

Open
AlessandroVol23 opened this issue Jun 8, 2024 · 2 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@AlessandroVol23
Copy link

Expected Behaviour

I used the default next.js starter kit npx create-next-app@latest nextjs-blog --use-pnpm --example "https://github.com/vercel/next-learn/tree/main/basics/learn-starter"

My expected behaviour would be that the deploy step is deploying the static files.

Current Behaviour

The build step fails with the following logs:

[Container] 2024/06/05 06:01:35.090350 Running command npx next export
73 | ⨯
74 | `next export` has been removed in favor of 'output: export' in next.config.js.
75 | Learn more: https://nextjs.org/docs/app/building-your-application/deploying/static-exports
76 |  
77

I know that only SSG and SPA are supported right now. But I think the developer experience could be improved if the CLI locally already fails or if the build command understands that next version xyz is not supporting this command anymore.

Code snippet

1. `npx create-next-app@latest nextjs-blog --use-pnpm --example "https://github.com/vercel/next-learn/tree/main/basics/learn-starter"`
2. `cloudfront-hosting-toolkit init`
3. `cloudfront-hosting-toolkit deploy`

Possible Solution

Show a warning locally / break locally

Steps to Reproduce

  1. npx create-next-app@latest nextjs-blog --use-pnpm --example "https://github.com/vercel/next-learn/tree/main/basics/learn-starter"
  2. cloudfront-hosting-toolkit init
  3. cloudfront-hosting-toolkit deploy
@AlessandroVol23 AlessandroVol23 added the bug Something isn't working label Jun 8, 2024
@cornelcroi
Copy link
Contributor

cornelcroi commented Jun 8, 2024

Hi,
Thank you for creating the issue.
I think I may have an idea for a nice and clean fix: identify the build command from package.json and execute it as it is instead of manually using the build cmd in the yml file.

@cornelcroi cornelcroi self-assigned this Jun 8, 2024
@AlessandroVol23
Copy link
Author

Hey 👋🏽
yers that sounds like a good approach. I'm not sure in which version this was changed. I couldn't find it right now sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants