1 / 3
Nov 2024

I encountered a strange issue 2-3 days ago. I started receiving the following error:
2-3일 전에 이상한 문제가 발생했습니다. 다음과 같은 오류가 나타나기 시작했습니다:

SyntaxError: Unexpected identifier '#Y' at wrapSafe (node:internal/modules/cjs/loader:1427:18) at Module._compile (node:internal/modules/cjs/loader:1449:20) at Module._extensions..js (node:internal/modules/cjs/loader:1588:10) at Module.load (node:internal/modules/cjs/loader:1282:32) at Module._load (node:internal/modules/cjs/loader:1098:12) at TracingChannel.traceSync (node:diagnostics_channel:315:14) at wrapModuleLoad (node:internal/modules/cjs/loader:215:24) at Module.require (node:internal/modules/cjs/loader:1304:12) at mod.require (E:\git\desafio-viajero-visitante\client\node_modules\next\dist\server\require-hook.js:65:28) at require (node:internal/modules/helpers:123:16) Error: Failed to collect page data for /api/dashboard/create-company at E:\git\desafio-viajero-visitante\client\node_modules\next\dist\build\utils.js:1268:15 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { type: 'Error' }

The route in question hadn’t been modified in over 21 days, so it seemed unlikely that it was the source of the error. After some debugging, I decided to delete the route and see what happened. This led to errors on other routes, so I continued deleting them. After removing 5 routes, I began to suspect that the issue wasn’t with the routes themselves. I eventually deleted most of them, but the same error persisted on routes that had been in production for over 3 months.
문제가 된 경로는 21일 이상 수정되지 않았기 때문에 오류의 원인일 가능성은 낮아 보였습니다. 디버깅을 진행한 후, 경로를 삭제해 보기로 했습니다. 그러자 다른 경로들에서 오류가 발생하기 시작했고, 계속해서 경로들을 삭제했습니다. 5개의 경로를 제거한 후에는 문제가 경로 자체에 있지 않다는 의심이 들기 시작했습니다. 결국 대부분의 경로를 삭제했지만, 3개월 이상 운영 중인 경로에서도 동일한 오류가 계속 발생했습니다.

I found some users on Google experiencing the same error, even when starting a new project from scratch with a Next.js template. This made the situation even more puzzling. I then reverted to a commit that was in production 1-2 months ago, but the error remained. Clearly, something external to my app is causing this issue.
구글에서 같은 오류를 겪는 사용자를 발견했는데, 심지어 Next.js 템플릿으로 새 프로젝트를 시작해도 같은 문제가 발생했습니다. 이로 인해 상황은 더욱 혼란스러워졌습니다. 이후 1-2개월 전에 운영 중이던 커밋으로 되돌렸지만 오류는 사라지지 않았습니다. 분명히 제 앱 외부의 무언가가 이 문제를 일으키고 있습니다.

Creating a new project isn’t an option since this one has been in production for over 6 months, and I need to deploy new adjustments today. I’ve performed a clean install on all branches and tests, deleted node_modules, and removed package-lock.json.
새 프로젝트를 만드는 것은 선택지가 아닙니다. 이 프로젝트는 6개월 이상 운영 중이며 오늘 새로운 조정을 배포해야 합니다. 모든 브랜치와 테스트에서 클린 설치를 수행했고, node_modules 를 삭제했으며, package-lock.json 도 제거했습니다.

Does anyone have any idea what might be causing this?
이 문제가 무엇 때문에 발생하는지 아시는 분 계신가요?

Here’s my package.json:  package.json 는 다음과 같습니다:

{ "name": "client", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev", "build": "next build", "start": "next start", "lint": "next lint" }, "dependencies": { "@hookform/resolvers": "^3.3.4", "@nivo/bar": "^0.87.0", "@nivo/line": "^0.87.0", "@nivo/pie": "^0.87.0", "@radix-ui/react-accordion": "^1.2.0", "@radix-ui/react-alert-dialog": "^1.0.5", "@radix-ui/react-aspect-ratio": "^1.1.0", "@radix-ui/react-avatar": "^1.0.4", "@radix-ui/react-checkbox": "^1.0.4", "@radix-ui/react-dialog": "^1.0.5", "@radix-ui/react-dropdown-menu": "^2.0.6", "@radix-ui/react-label": "^2.0.2", "@radix-ui/react-popover": "^1.0.7", "@radix-ui/react-radio-group": "^1.2.0", "@radix-ui/react-select": "^2.0.0", "@radix-ui/react-separator": "^1.0.3", "@radix-ui/react-slot": "^1.0.2", "@radix-ui/react-tabs": "^1.0.4", "@radix-ui/react-toast": "^1.1.5", "@radix-ui/react-tooltip": "^1.1.1", "@react-three/fiber": "^8.15.16", "@sentry/nextjs": "^8.17.0", "@tanstack/react-table": "^8.16.0", "@vercel/speed-insights": "^1.0.12", "@wojtekmaj/react-hooks": "^1.21.0", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "date-fns": "^3.6.0", "firebase": "^10.8.1", "firebase-admin": "^12.0.0", "js-cookie": "^3.0.5", "lucide-react": "^0.378.0", "multer": "^1.4.5-lts.1", "next": "^14.2.3", "next-themes": "^0.3.0", "nodemailer": "^6.9.13", "papaparse": "^5.4.1", "react": "^18", "react-audio-voice-recorder": "^2.2.0", "react-day-picker": "^8.10.1", "react-dom": "^18", "react-dropzone": "^14.2.3", "react-hook-form": "^7.51.4", "react-pdf": "^9.1.0", "react-player": "^2.16.0", "react-qr-code": "^2.0.15", "react-record-webcam": "^1.1.5", "react-unity-webgl": "^9.5.1", "react-webcam": "^7.2.0", "sonner": "^1.5.0", "tailwind-merge": "^2.3.0", "tailwindcss-animate": "^1.0.7", "three": "^0.162.0", "uuid": "^9.0.1", "vaul": "^0.9.1", "zod": "^3.23.6" }, "devDependencies": { "@eslint/js": "^9.9.0", "autoprefixer": "^10.0.1", "eslint": "^8.57.0", "eslint-config-next": "14.1.0", "eslint-plugin-react": "^7.35.0", "globals": "^15.9.0", "postcss": "^8", "tailwindcss": "^3.3.0" } }

Any insights would be greatly appreciated.
어떤 조언이라도 매우 감사하겠습니다.

Hi @feliprado! Welcome to the Vercel Community :smile:
안녕하세요 @feliprado! Vercel 커뮤니티에 오신 것을 환영합니다 :smile:

Thanks for the detailed description. Let’s tackle this strange issue with some quick checks:
자세한 설명 감사합니다. 이 이상한 문제를 빠른 점검으로 해결해 봅시다:

  1. Node.js Version: Ensure consistency with an .nvmrc file:
    Node.js 버전: .nvmrc 파일과 일치하는지 확인하세요:
echo "18.17.0" > .nvmrc # Replace with your project's Node version
  1. Next.js Version: Try downgrading:
    Next.js 버전: 버전을 낮춰서 시도해 보세요:
npm install next@14.1.0npm install next@14.1.0
  1. Babel: Check for custom configs interfering with Next.js.
    Babel: Next.js에 영향을 주는 사용자 지정 구성이 있는지 확인하세요.
  2. TypeScript: Verify tsconfig.json compatibility with your Next.js version.
    TypeScript: tsconfig.json 가 사용 중인 Next.js 버전과 호환되는지 확인하세요.
  3. ESLint: Temporarily disable to isolate the issue:
    ESLint: 문제를 분리하기 위해 일시적으로 비활성화하세요:
mv .eslintrc.json .eslintrc.json.bakmv .eslintrc.json .eslintrc.json.bak
  1. Next.js Cache: Clear it:  Next.js 캐시: 삭제하세요:
rm -rf .nextrm -rf .next
  1. Dependencies: Update all:
    종속성: 모두 업데이트:
npx npm-check-updates -u && npm installnpx npm-check-updates -u && npm install
  1. File Encoding: Ensure UTF-8 without BOM for all files.
    파일 인코딩: 모든 파일이 BOM 없는 UTF-8인지 확인하세요.
  2. Environment Variables: Review, especially in API routes.
    환경 변수: 특히 API 경로에서 검토하세요.
  3. Experimental Flag: Add to package.json scripts:
    실험적 플래그: package.json 스크립트에 추가:
"dev": "node --experimental-vm-modules node_modules/next/dist/bin/next dev""dev": "node --experimental-vm-modules node_modules/next/dist/bin/next dev"

(Do the same for “build” and “start” scripts)
(“build” 및 “start” 스크립트에도 동일하게 적용하세요)

If these don’t work, try creating a minimal reproduction.
이 방법들이 작동하지 않으면, 최소한의 재현 환경을 만들어 보세요.

Good luck, and let us know how it goes!
행운을 빕니다, 진행 상황을 알려 주세요!

Closed on Nov 20, 2024
2024년 11월 20일에 종료됨

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
이 주제는 마지막 답글 후 7일이 지나 자동으로 종료되었습니다. 새로운 답글은 더 이상 허용되지 않습니다.