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 with appDir fails #45507

Open
1 task done
kevzettler opened this issue Feb 2, 2023 · 7 comments
Open
1 task done

Next export with appDir fails #45507

kevzettler opened this issue Feb 2, 2023 · 7 comments
Labels
bug Issue was opened via the bug report template. stale The issue has not seen recent activity.

Comments

@kevzettler
Copy link

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 21.5.0: Tue Apr 26 21:08:29 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T8101
Binaries:
  Node: 18.13.0
  npm: 8.19.3
  Yarn: 3.4.1
  pnpm: N/A
Relevant packages:
  next: 13.1.7-canary.2
  eslint-config-next: N/A
  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 (next export)

Link to the code that reproduces this issue

https://github.com/kevzettler/bad-nextjs-export-bug

To Reproduce

npm install && next build && next export

Describe the Bug

next export fails with the following

warn  - You have enabled experimental feature (appDir) in next.config.js.
warn  - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk.
info  - Thank you for testing `appDir` please leave your feedback at https://nextjs.link/app-feedback

info  - using build directory: /Users/kevzettler/code/bad-nextjs-export-bug/.next
info  - Copying "static build" directory
info  - No "exportPathMap" found in "/Users/kevzettler/code/bad-nextjs-export-bug/next.config.js". Generating map from "./pages"
info  - Launching 7 workers
info  - Copying "public" directory
info  - Exporting (2/2)
PageNotFoundError: Cannot find module for page: /about
    at Object.getPagePath (/Users/kevzettler/code/bad-nextjs-export-bug/node_modules/next/dist/server/require.js:77:15)
    at /Users/kevzettler/code/bad-nextjs-export-bug/node_modules/next/dist/export/index.js:382:48
    at Array.map (<anonymous>)
    at /Users/kevzettler/code/bad-nextjs-export-bug/node_modules/next/dist/export/index.js:373:69
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Span.traceAsyncFn (/Users/kevzettler/code/bad-nextjs-export-bug/node_modules/next/dist/trace/trace.js:79:20) {
  code: 'ENOENT'
}

Expected Behavior

More clarity in the error message. What is actually missing? The file app/about/page.tsx exists and renders in next dev

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

@kevzettler kevzettler added the bug Issue was opened via the bug report template. label Feb 2, 2023
@kevzettler kevzettler changed the title Next export fails Next export with appDir fails Feb 2, 2023
@HummingMind
Copy link

Next export is not yet available/supported for appDir in next 13 as far as I know.
You can track the status on the roadmap page: here

@pixelpax
Copy link

pixelpax commented Feb 7, 2023

Damn. I really need this feature. This is a blocker on my app :/

@kevzettler
Copy link
Author

Yeah this is a bummer I wouldn't have used the latest version had I know this was broken. Now I guess I'll port to an earlier version and by the time I migrate I assume export will probably be available in the appDir support

@HummingMind
Copy link

HummingMind commented Feb 8, 2023

You don't have to port to the older version. You can stay on 13. Just don't use appDir. That way you get all the other improvements of v13.

@pixelpax
Copy link

pixelpax commented Feb 8, 2023

You don't have to port to the older version. You can stay on 13. Just don't use appDir. That way you get all the other improvements of v13.

That's fair; I've just already put ~150 hours into structuring my app around functional async server side components, which I can't use in pages/

This is actually the only problem I've encountered so far that seems too in-the-weeds of the build process for me to address. I'll just cross my fingers for a workaround soon 🤞

spejamchr added a commit to spejamchr/nuvole-client that referenced this issue Mar 14, 2023
@gyurielf
Copy link

gyurielf commented Mar 17, 2023

Hello there!

FYI - Seems to be it's supported now:
#47022

@nextjs-bot
Copy link
Collaborator

This issue has been automatically marked as stale due to two years of inactivity. It will be closed in 7 days unless there’s further input. If you believe this issue is still relevant, please leave a comment or provide updated details. Thank you.

@nextjs-bot nextjs-bot added the stale The issue has not seen recent activity. label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. stale The issue has not seen recent activity.
Projects
None yet
Development

No branches or pull requests

5 participants