Next JS 14.0.1 - 无法获取 ./node_modules/entities/lib/esm/index.js 的导出“encodeXML”的最终名称

问题描述 投票:0回答:1

因此,我正在尝试将我的投资组合网站部署到 Vercel 或 Netlify,但我遇到了这个问题。 Vercel 和 Netlify 都是一样的

[23:18:24.904] Running build in Washington, D.C., USA (East) – iad1 (Hive)
[23:18:25.024] Retrieving list of deployment files...
[23:18:25.448] Previous build cache not available
[23:18:25.726] Downloading 51 deployment files...
[23:18:26.417] Running "vercel build"
[23:18:26.942] Vercel CLI 32.5.2
[23:18:27.337] Installing dependencies...
[23:18:39.394] 
[23:18:39.395] added 419 packages in 12s
[23:18:39.395] 
[23:18:39.396] 140 packages are looking for funding
[23:18:39.396]   run `npm fund` for details
[23:18:39.418] Detected Next.js version: 14.0.1
[23:18:39.422] Detected `package-lock.json` generated by npm 7+
[23:18:39.422] Running "npm run build"
[23:18:42.418] 
[23:18:42.419] > [email protected] build
[23:18:42.419] > next build
[23:18:42.419] 
[23:18:43.265] Attention: Next.js now collects completely anonymous telemetry regarding usage.
[23:18:43.265] This information is used to shape Next.js' roadmap and prioritize features.
[23:18:43.265] You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
[23:18:43.266] https://nextjs.org/telemetry
[23:18:43.266] 
[23:18:43.489]    ▲ Next.js 14.0.1
[23:18:43.490]    - Environments: .env
[23:18:43.491] 
[23:18:43.492]    Creating an optimized production build ...
[23:18:53.589] Failed to compile.
[23:18:53.590] 
[23:18:53.590] ./node_modules/html-to-text/lib/html-to-text.mjs + 24 modules
[23:18:53.590] Cannot get final name for export 'encodeXML' of ./node_modules/entities/lib/esm/index.js
[23:18:53.590] 
[23:18:53.591] 
[23:18:53.592] > Build failed because of webpack errors
[23:18:53.636] Error: Command "npm run build" exited with 1
[23:18:53.840] 

当我尝试手动构建时,我收到此错误

 Failed to compile.
./node_modules/html-to-text/lib/html-to-text.mjs + 24 modules
  Cannot get final name for export 'encodeXML' of ./node_modules/entities/lib/esm/index.js
Build failed because of webpack errors
Error: Command "npm run build" exited with 1

我正在分享我的 Package.json 文件以便更好地理解

    {
  "name": "kaustubhdev",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@react-email/components": "^0.0.11",
    "@react-email/tailwind": "^0.0.12",
    "next": "14.0.1",
    "react": "^18",
    "react-dom": "^18",
    "react-hot-toast": "^2.4.1",
    "react-icons": "^4.11.0",
    "resend": "^2.0.0"
  },
  "devDependencies": {
    "@types/node": "^20",
    "@types/react": "^18",
    "@types/react-dom": "^18",
    "autoprefixer": "^10.0.1",
    "eslint": "^8",
    "eslint-config-next": "14.0.1",
    "postcss": "^8",
    "tailwindcss": "^3.3.0",
    "typescript": "^5"
  }
}

即使尝试使用 GitHub 或直接通过 CLI 部署网站,此问题仍然存在

npm next.js vercel netlify
1个回答
0
投票

这是与重新发送电子邮件 SDK 版本 2 相关的错误 因此,处理此问题的最佳方法是降级到版本 1。

人们已经在 GitHub 上提出了 PR

© www.soinside.com 2019 - 2024. All rights reserved.