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 ができない #51

Closed
Atis9 opened this issue May 1, 2022 · 5 comments
Closed

next export ができない #51

Atis9 opened this issue May 1, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@Atis9
Copy link
Owner

Atis9 commented May 1, 2022

バグについての説明
next export ができない

再現するために
動作を再現するための手順:

  1. yarn next build && yarn next export

期待される動作
/out に出力されること

補足説明

❯ yarn next export
yarn run v1.22.18
$ /home/atis/repositories/nyantech.com/node_modules/.bin/next export
info  - using build directory: /home/atis/repositories/nyantech.com/.next
info  - Copying "static build" directory
info  - No "exportPathMap" found in "/home/atis/repositories/nyantech.com/next.config.js". Generating map from "./pages"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.
    - Use any provider which supports Image Optimization (like Vercel).
    - Configure a third-party loader in `next.config.js`.
    - Use the `loader` prop for `next/image`.
  Read more: https://nextjs.org/docs/messages/export-image-api
    at /home/atis/repositories/nyantech.com/node_modules/next/dist/export/index.js:156:23
    at async Span.traceAsyncFn (/home/atis/repositories/nyantech.com/node_modules/next/dist/trace/trace.js:79:20)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@Atis9 Atis9 added the bug Something isn't working label May 1, 2022
@Atis9 Atis9 self-assigned this May 1, 2022
@Atis9
Copy link
Owner Author

Atis9 commented May 1, 2022

Img (next/image) での最適化は export に対応していないことが原因。
別の方法で最適化するには下記が参考になりそう。
Image optimization for static NextJS sites

@Atis9
Copy link
Owner Author

Atis9 commented May 1, 2022

今回は Cloudflare Pages にデプロイを試したときに発生した事象。
素直に Vercel を使うなら対応はいらない。

@Atis9
Copy link
Owner Author

Atis9 commented May 1, 2022

Next.js の SSR を放り投げて SSG にのみ対応させるなら Cloudflare Pages へのデプロイを検討してもよい。
GitHub Team で GitHub Codespaces を使おうとすると Vercel Pro の契約が必須になる (Team/Organization のリポジトリは Vercel Pro でないとデプロイできない) ため、ランニングコストが高くなる。
どう運用するか含め、要検討。

@Atis9
Copy link
Owner Author

Atis9 commented May 1, 2022

現状 SSR でやりたいことはないので SSG に特化させていいとは思っている。
Next.js である必要もなくなってしまうと思うが。

@Atis9
Copy link
Owner Author

Atis9 commented Jun 14, 2023

Vercel で運用するので対応しない

@Atis9 Atis9 closed this as completed Jun 14, 2023
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

1 participant