@frames.js/render Build error occurred Error: Failed to collect page data for
Error
% yarn next build
yarn run v1.22.19
$ /Users/stephan/environments/mod/frames-render-demo/node_modules/.bin/next build
▲ Next.js 14.2.3
Creating an optimized production build ...
✓ Compiled successfully
✓ Linting and checking validity of types
Collecting page data ../Users/stephan/environments/mod/frames-render-demo/.next/server/app/page.js:32
*/e.parse=o,e.serialize=s;var i=decodeURIComponent,n=encodeURIComponent,r=/; */,t=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function o(e,a){if("string"!=typeof e)throw TypeError("argument str must be a string");for(var n={},t=a||{},o=e.split(r),s=t.decode||i,u=0;u
...
__create(__getProtoOf(e)):{},__copyProps(!a&&e&&e.__esModule?i:__defProp(i,"default",{value:e,enumerable:!0}),e)),__publicField=(e,a,i)=>(__defNormalProp(e,"symbol"!=typeof a?a+"":a,i),i),init_esm_shims=__esm({"../../node_modules/tsup/assets/esm_shims.js"(){}}),require_long=__commonJS({"../../node_modules/long/src/long.js"(e,a){init_esm_shims(),a.exp
> Build error occurred
Error: Failed to collect page data for /
at /Users/stephan/environments/mod/frames-render-demo/node_modules/next/dist/build/utils.js:1268:15
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
type: 'Error'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Steps to reproduce
- Create a new next.js app using create-next-app
- follow usage guide at https://framesjs.org/guides/apps/display-frames
yarn build- error
Workaround
Fix the error by disabling prebuilding
yarn next build --experimental-build-mode compile
This is an upstream issue, probably in next.js. It doesn't work in [email protected] but downgrading to 14.1.4 fixes that.
I was able to trace it to @farcaster/core dependency that breaks the [email protected] production build, but wasn't able to find what exactly causes the build to fail.
just confirmed this is still an issue for nextjs builds, but the work around for the next build still fixes it.
Could it be related to https://github.com/farcasterxyz/hub-monorepo/issues/2031#issuecomment-2154855700 ?
I'm running into the same issue. The workaround doesn't work for me. It builds successfully but running it leads to the following error:
Identifier 'a56' has already been declared
I'm using useAnonymousIdentity if that makes a difference.
Identifier 'a56' has already been declared
have you tried setting swcMinify: false, in next.config.js @pdelfan ?
@davidfurlong FYI @pdelfan is doing experiments with Bluesky.
Identifier 'a56' has already been declaredhave you tried setting
swcMinify: false, innext.config.js@pdelfan ?
Thanks! I downgraded to 14.1.4 and tried it, but the it leads to another error:
./node_modules/cheerio/node_modules/undici/lib/web/fetch/util.js
Module parse failed: Unexpected token (860:57)
File was processed with these loaders:
* ./node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js
* ./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js
You may need an additional loader to handle the result of these loaders.
| // 5. If object is not a default iterator object for interface,
| // then throw a TypeError.
> if (typeof this !== 'object' || this === null || !(#target in this)) {
| throw new TypeError(
| `'next' called on an object that does not implement interface ${name} Iterator.`
Import trace for requested module:
./node_modules/cheerio/node_modules/undici/lib/web/fetch/util.js
./node_modules/cheerio/node_modules/undici/lib/web/fetch/headers.js
./node_modules/cheerio/node_modules/undici/index.js
./node_modules/cheerio/dist/esm/index.js
./node_modules/frames.js/dist/chunk-N6D3CXG6.js
./node_modules/frames.js/dist/index.js
./node_modules/@frames.js/render/dist/chunk-OGFFZ33X.js
./node_modules/@frames.js/render/dist/next/index.js
./src/app/api/frames/route.tsx
It does work in dev mode:
https://github.com/user-attachments/assets/4ce090dc-653f-4149-99b3-07acce96deb9
I met this issue too. It's only working for dev.
Any solution?
this issue is fixed by next in next.js version 15