Closed stepcellwolf closed 10 months ago
Try using node 18+. It seems like it's not able to read the ./generated
created by contentlayer.
Hi, same error, with the following Environment details:
Run yarn next build yarn next build shell: /usr/bin/bash -e {0} env: GITHUB_PAGES: true ⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache Attention: Next.js now collects completely anonymous telemetry regarding usage. This information is used to shape Next.js' roadmap and prioritize features. You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL: https://nextjs.org/telemetry
Creating an optimized production build ... Failed to compile.
./app/about/page.tsx Module not found: Package path ./generated is not exported from package /home/runner/work/pt-nextjs-blog/pt-nextjs-blog/node_modules/contentlayer (see exports field in /home/runner/work/pt-nextjs-blog/pt-nextjs-blog/node_modules/contentlayer/package.json)
https://nextjs.org/docs/messages/module-not-found
./app/blog/[...slug]/page.tsx Module not found: Package path ./generated is not exported from package /home/runner/work/pt-nextjs-blog/pt-nextjs-blog/node_modules/contentlayer (see exports field in /home/runner/work/pt-nextjs-blog/pt-nextjs-blog/node_modules/contentlayer/package.json)
https://nextjs.org/docs/messages/module-not-found
./app/blog/page.tsx Module not found: Package path ./generated is not exported from package /home/runner/work/pt-nextjs-blog/pt-nextjs-blog/node_modules/contentlayer (see exports field in /home/runner/work/pt-nextjs-blog/pt-nextjs-blog/node_modules/contentlayer/package.json)
https://nextjs.org/docs/messages/module-not-found
./app/blog/page/[page]/page.tsx Module not found: Package path ./generated is not exported from package /home/runner/work/pt-nextjs-blog/pt-nextjs-blog/node_modules/contentlayer (see exports field in /home/runner/work/pt-nextjs-blog/pt-nextjs-blog/node_modules/contentlayer/package.json)
https://nextjs.org/docs/messages/module-not-found
./app/page.tsx Module not found: Package path ./generated is not exported from package /home/runner/work/pt-nextjs-blog/pt-nextjs-blog/node_modules/contentlayer (see exports field in /home/runner/work/pt-nextjs-blog/pt-nextjs-blog/node_modules/contentlayer/package.json)
https://nextjs.org/docs/messages/module-not-found
Build failed because of webpack errors Error: Process completed with exit code 1.
Hi @timlrx any updates on this one. It seems is not working with node 18+ either.
Sorry about this, I don't really have time currently to investigate why the github runner is not picking up the .contentlayer/generated
folder or if it is correctly generating.
Could you try triggering contentlayer manually in the github build process: npx contentlayer build
. if it is not able to find this then I am out of ideas and maybe you could try checking with the contentlayer github to see if anyone has tried integrating it with github action.
Thanks, no worries. I already tried with npx contentlayer build
still same issue. Let me try with other images, and I already reached out to the contentlayer github community.
Here's a successful deployment: https://github.com/timlrx/tailwind-nextjs-starter-blog/tree/test-gh-pages-static. I just used yarn as the package manager and did not encounter any issues, other than github pages specific changes which I had to fix.
HI Thanks a lot. I also managed to deploy it by myself last night. Here is the workflow code: https://github.com/stepcellwolf/pt-nextjs-blog/blob/main/.github/workflows/nextjs.yml.
With the contentlayer
version 0.3.4
Thanks a lot.
Describe the bug
When I run npm run build in local machine it is working, however when I tried with GitHub page/actions workflow it is not working. Please see the following error: `Run yarn next build ⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache Attention: Next.js now collects completely anonymous telemetry regarding usage. This information is used to shape Next.js' roadmap and prioritize features. You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL: https://nextjs.org/telemetry
Creating an optimized production build ... Failed to compile.
./app/about/page.tsx Module not found: Package path ./generated is not exported from package /home/runner/work/pt-nextjs-blog/pt-nextjs-blog/node_modules/contentlayer (see exports field in /home/runner/work/pt-nextjs-blog/pt-nextjs-blog/node_modules/contentlayer/package.json)
https://nextjs.org/docs/messages/module-not-found
./app/blog/[...slug]/page.tsx Module not found: Package path ./generated is not exported from package /home/runner/work/pt-nextjs-blog/pt-nextjs-blog/node_modules/contentlayer (see exports field in /home/runner/work/pt-nextjs-blog/pt-nextjs-blog/node_modules/contentlayer/package.json)
https://nextjs.org/docs/messages/module-not-found
./app/blog/page.tsx Module not found: Package path ./generated is not exported from package /home/runner/work/pt-nextjs-blog/pt-nextjs-blog/node_modules/contentlayer (see exports field in /home/runner/work/pt-nextjs-blog/pt-nextjs-blog/node_modules/contentlayer/package.json)
https://nextjs.org/docs/messages/module-not-found
./app/blog/page/[page]/page.tsx Module not found: Package path ./generated is not exported from package /home/runner/work/pt-nextjs-blog/pt-nextjs-blog/node_modules/contentlayer (see exports field in /home/runner/work/pt-nextjs-blog/pt-nextjs-blog/node_modules/contentlayer/package.json)
https://nextjs.org/docs/messages/module-not-found
./app/page.tsx Module not found: Package path ./generated is not exported from package /home/runner/work/pt-nextjs-blog/pt-nextjs-blog/node_modules/contentlayer (see exports field in /home/runner/work/pt-nextjs-blog/pt-nextjs-blog/node_modules/contentlayer/package.json)
https://nextjs.org/docs/messages/module-not-found
Summary Annotations 1 error 1 and warning Build error: Process completed with exit code 1.
Build warning: Unsupported configuration file extension. Currently supported extensions: ".js", ".cjs", ".mjs"
To Reproduce Here is the Github workflow.
Expected behavior Tried with cleaning the cache, remove and install from beginning the npm modules, and packages. And node versino is same as in GitHub Action
System Info (if dev / build issue):
Additional context Full repository available at Link