cloudflare / next-on-pages

CLI to build and develop Next.js apps for Cloudflare Pages
https://www.npmjs.com/package/@cloudflare/next-on-pages
MIT License
1.27k stars 121 forks source link

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

Open andrepcg opened 1 week ago

andrepcg commented 1 week ago

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?

james-elicx commented 1 week ago

Are you able to share a reproduction for this?

andrepcg commented 1 week ago

@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 commented 1 week ago

@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