awslabs / awslabs/cloudfront-hosting-toolkit

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

Open
#7 2 comments 0 reactions 1 assignee Claimed by @cornelcroi View on GitHub
bug
Dominant language
TypeScript
Stars
112
Forks
3
PR merge metrics
No merged PRs in 30d

Description

### 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

```python
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`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.