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

@frames.js/render Build error occurred Error: Failed to collect page data for #393

Open
stephancill opened this issue May 20, 2024 · 9 comments

Comments

@stephancill
Copy link
Contributor

stephancill commented May 20, 2024

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

  1. Create a new next.js app using create-next-app
  2. follow usage guide at https://framesjs.org/guides/apps/display-frames
  3. yarn build
  4. error

Workaround

Fix the error by disabling prebuilding

yarn next build --experimental-build-mode compile
@stephancill stephancill added the bug Something isn't working label May 20, 2024
@stephancill stephancill changed the title @frames.js/render Build error occurred Error: Failed to collect page data for / @frames.js/render Build error occurred Error: Failed to collect page data for May 20, 2024
@michalkvasnicak
Copy link
Collaborator

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.

@michalkvasnicak michalkvasnicak removed the bug Something isn't working label May 23, 2024
@chuckstock
Copy link

just confirmed this is still an issue for nextjs builds, but the work around for the next build still fixes it.

@porenes
Copy link

porenes commented Aug 19, 2024

Could it be related to farcasterxyz/hub-monorepo#2031 (comment) ?

@davidfurlong davidfurlong closed this as not planned Won't fix, can't repro, duplicate, stale Sep 5, 2024
@davidfurlong davidfurlong reopened this Sep 5, 2024
@pdelfan
Copy link

pdelfan commented Sep 12, 2024

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.

@davidfurlong davidfurlong added the Frames.js label Sep 13, 2024 — with Linear
@davidfurlong
Copy link
Contributor

Identifier 'a56' has already been declared

have you tried setting swcMinify: false, in next.config.js @pdelfan ?

@bmann
Copy link

bmann commented Sep 13, 2024

@davidfurlong FYI @pdelfan is doing experiments with Bluesky.

@pdelfan
Copy link

pdelfan commented Sep 13, 2024

Identifier 'a56' has already been declared

have you tried setting swcMinify: false, in next.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:

compressed_video.mp4

@huweihong
Copy link

huweihong commented Oct 21, 2024

I met this issue too. It's only working for dev.

@ishaan812
Copy link

Any solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants