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

Next export broken in 13.3.1 (app dir) #48711

Open
1 task done
re-thc opened this issue Apr 22, 2023 · 5 comments
Open
1 task done

Next export broken in 13.3.1 (app dir) #48711

re-thc opened this issue Apr 22, 2023 · 5 comments
Labels
area: app App directory (appDir: true) bug Issue was opened via the bug report template.

Comments

@re-thc
Copy link

re-thc commented Apr 22, 2023

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 22.4.0: Mon Mar  6 20:59:28 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T6000
    Binaries:
      Node: 20.0.0
      npm: 9.4.0
      pnpm: 8.3.1
    Relevant packages:
      next: 13.3.1
      react: 18.2.0
      react-dom: 18.2.0

Which area(s) of Next.js are affected? (leave empty if unsure)

App directory (appDir: true), Static HTML Export (output: "export")

Link to the code that reproduces this issue

N/A

To Reproduce

next build

Describe the Bug

html files are missing from the output

Expected Behavior

html files should be present (works if degrade to 13.3.0)

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

@re-thc re-thc added the bug Issue was opened via the bug report template. label Apr 22, 2023
@github-actions github-actions bot added the area: app App directory (appDir: true) label Apr 22, 2023
@samulisuomi
Copy link

Which area(s) of Next.js are affected? (leave empty if unsure)

App directory (appDir: true), Static HTML Export (output: "export")

Just making sure: in next.config.js, did you add output to the root of nextConfig or inside experimental? I did the latter and was confused for a while.

I.e. this does not work:

/** @type {import('next').NextConfig} */
const nextConfig = {
  experimental: {
    appDir: true,
    output: 'export',
  },
}

module.exports = nextConfig

This does work for me:

```tsx
/** @type {import('next').NextConfig} */
const nextConfig = {
  output: 'export',
  experimental: {
    appDir: true,
  },
}

module.exports = nextConfig

@re-thc
Copy link
Author

re-thc commented Apr 27, 2023

@samulisuomi outside of experimental.

It works for 13.3.0 and only broke on 13.3.1 and it actually builds just doesn't output html (does output js/css).

@samulisuomi
Copy link

samulisuomi commented Apr 27, 2023

Hmm... Very strange. I'm on 13.3.1 too and it does work.

image

That's what I get after changing my config and running npm run build (== next build). Fwiw I don't use page folder at all – just app – and the app itself is a very small dummy demo app for a workshop at my job.

I do encounter other issues with the app folder + static export combo myself (related to dynamic route segments) but the HTML files themselves are exported to out.

Just a long shot but what if you upgrade to the later next version and run npm ci (that nukes node_modules) and then retry next build?

@re-thc
Copy link
Author

re-thc commented Apr 27, 2023

@samulisuomi perhaps it is related to dynamic routes. Due to i18n all my routes are in dynamic segments / getStaticParams. No luck with nuking.

@samulisuomi
Copy link

@re-thc here’s a related issue I’ve been following, not sure if it helps: #48022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: app App directory (appDir: true) bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

2 participants