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

[🐛 Bug]: ERROR: A duplicated identifier has been detected in the same function file, aborting. #891

Open
1 task
andrepcg opened this issue Oct 8, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@andrepcg
Copy link

andrepcg commented Oct 8, 2024

next-on-pages environment related information

System:
Platform: linux
Arch: x64
Version: #1 SMP Debian 5.10.191-1 (2023-08-16)
CPU: (3) x64 Common KVM processor
Memory: 5 GB
Shell: /usr/bin/zsh
Package Manager Used: npm (10.2.4)

Relevant Packages:
@cloudflare/next-on-pages: 1.13.4
vercel: N/A
next: 13.5.6

Description

After v1.13.4 I started to get ERROR: A duplicated identifier has been detected in the same function file, aborting. Using v1.13.5 still results in the same error.

next-on-pages@1.13.3 works fine
next-on-pages@1.13.4 doesn't work
next-on-pages@1.13.5 doesn't work

npx vercel build works

Reproduction

No response

Pages Deployment Method

Pages CI (GitHub/GitLab integration)

Pages Deployment ID

27b1a3f7-1fc6-4ba9-8cf2-f291a8509cdf

Additional Information

Dependencies in the project

  "dependencies": {
    "@emotion/react": "^11.11.4",
    "@emotion/styled": "^11.11.0",
    "@meronex/icons": "^4.0.0",
    "@mui/material": "^5.15.14",
    "@sentry/nextjs": "^8.27.0",
    "@sentry/react": "^8.27.0",
    "@themesberg/flowbite": "^1.1.1",
    "@tippyjs/react": "^4.2.6",
    "@weareredlight/denormalize_json_api": "^0.2.2",
    "classnames": "^2.3.1",
    "formik": "^2.2.9",
    "lodash.orderby": "^4.6.0",
    "lodash.throttle": "^4.1.1",
    "next": "^13.5.6",
    "nuka-carousel": "^5.2.0",
    "react": "^18.1.0",
    "react-country-flag": "^3.0.2",
    "react-dom": "^18.1.0",
    "react-onclickoutside": "^6.12.0",
    "react-player": "^2.9.0",
    "react-select-country-list": "^2.2.3",
    "react-social-media-embed": "^2.2.2",
    "react-svg": "^15.0",
    "zustand": "^3.6.5"
  }

Would you like to help?

  • Would you like to help fixing this bug?
@andrepcg andrepcg added the bug Something isn't working label Oct 8, 2024
@james-elicx
Copy link
Contributor

Are you able to share a reproduction for this?

@andrepcg
Copy link
Author

andrepcg commented Oct 8, 2024

@james-elicx Unfortunately no. My gut feeling is that it is related to using both @sentry/nextjs and @sentry/react packages but I haven't tried it yet, will do it later

@andrepcg
Copy link
Author

andrepcg commented Oct 8, 2024

@james-elicx Nope, that didnt do anything. Tried to remove a bunch of other packages without success.

What it's clear is that version 1.13.4 introduced the issue. Clear as water

@micooz
Copy link

micooz commented Oct 31, 2024

same issue, @cloudflare/next-on-pages v1.13.5 works for me two days ago, but failed today. Revert my lockfile works fine.

My guess is that some dependency upgrade is not compatible with this PR: #886

@orliesaurus
Copy link

Also seeing this issue after installing @sentry/nextjs

@kruszczynski
Copy link

Reverting @sentry/nextjs to 8.35.0 fixed that issue for me

@psincraian
Copy link

I also have the same problem with sentry and nextjs. with next-on-pages 1.13.2 I don't have this problem

@hitsthings
Copy link

hitsthings commented Dec 10, 2024

I am seeing this on next-on-pages 1.13.6. The duplicated identifier happens to be "26195" and seems to be a small wrapper around node:buffer. E.g. the files in .next almost all have this: {26195:t=>{"use strict";t.exports=require("node:buffer")} ...}

By the time it gets to .vercel/output they tend to all have it defined twice:

E.g. Line 10:

...(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[118],{26195:t=>{"use strict";t.exports=require("node:buffer")}...

Line 142:

...(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[323],{2067:e=>{"use strict";e.exports=require("node:async_hooks")},26195:e=>{"use strict";e.exports=require("node:buffer")},...

Vercel version is "39.1.1". Worth nothing that same version worked fine with next-on-pages 1.13.5 (but I also changed other dependencies, so maybe a fluke).

Can confirm that reverting sentry/nextjs to 8.35.0 from 8.39.0 solves this, and now the reference on line 10 is gone - only the line 142 reference is left.

travis added a commit to storacha/console that referenced this issue Dec 13, 2024
the latest versions of the sentry next.js plugin seem to have a bug that breaks next-on-pages: cloudflare/next-on-pages#891

pin to fix
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

7 participants