next.js icon indicating copy to clipboard operation
next.js copied to clipboard

next export does not work out of box

Open Jack-Works opened this issue 3 years ago • 0 comments

Verify canary release

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

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 10 Pro for Workstations
Binaries:
  Node: 18.11.0
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant packages:
  next: 13.0.3
  eslint-config-next: 13.0.3
  react: 18.2.0
  react-dom: 18.2.0

What browser are you using? (if relevant)

not relevant

How are you deploying your application? (if relevant)

not relevant

Describe the Bug

next export does not work out of box

Not working with pages:

pnpm create next-app
cd project
npx next build
npx next export
Error: Image Optimization using Next.js' default loader is not compatible with `next export`.
  Possible solutions:
    - Use `next start` to run a server, which includes the Image Optimization API.
    - Configure `images.unoptimized = true` in `next.config.js` to disable the Image Optimization API.
  Read more: https://nextjs.org/docs/messages/export-image-api

Not working with app:

pnpm create next-app --experimental-app
cd project
npx next build
npx next export
info  - Thank you for testing `appDir` please leave your feedback at https://nextjs.link/app-feedback

info  - using build directory: 
info  - Copying "static build" directory
info  - No "exportPathMap" found in "next.config.js". Generating map from "./pages"
info  - Launching 23 workers
warn  - Statically exporting a Next.js application via `next export` disables API routes.
This command is meant for static-only hosts, and is not necessary to make your application static.
Pages in your application without server-side data dependencies will be automatically statically exported by `next build`, including pages powered by `getStaticProps`.
Learn more: https://nextjs.org/docs/messages/api-routes-static-export
info  - Copying "public" directory
info  - Exporting (2/2)
PageNotFoundError: Cannot find module for page: /

Expected Behavior

Working out of the box

Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster

N/A

To Reproduce

given above

Jack-Works avatar Nov 16 '22 15:11 Jack-Works