Open stephancill opened 4 months ago
This is an upstream issue, probably in next.js
. It doesn't work in next@14.2.x
but downgrading to 14.1.4
fixes that.
I was able to trace it to @farcaster/core
dependency that breaks the next.js@14.2.x
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 declared
have 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
Error
Steps to reproduce
yarn build
Workaround
Fix the error by disabling prebuilding