解决 Two output files share the same path but have different contents

10 min read
  • 检查错误内容里面的出错的包是否存在大小写混用的情况
  • 清空lock文件,重新生成
✘ [ERROR] Two output files share the same path but have different contents: node_modules/.vite/deps_temp/Vue.js

/Users/pan/Desktop/energy_analysis/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1624
  let error = new Error(`${text}${summary}`);
              ^

Error: Build failed with 1 error:
error: Two output files share the same path but have different contents: node_modules/.vite/deps_temp/Vue.js
    at failureErrorWithLog (/Users/pan/Desktop/energy_analysis/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1624:15)
    at /Users/pan/Desktop/energy_analysis/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1266:28
    at runOnEndCallbacks (/Users/pan/Desktop/energy_analysis/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1046:63)
    at buildResponseToResult (/Users/pan/Desktop/energy_analysis/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1264:7)
    at /Users/pan/Desktop/energy_analysis/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1377:14
    at /Users/pan/Desktop/energy_analysis/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:678:9
    at handleIncomingPacket (/Users/pan/Desktop/energy_analysis/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:775:9)
    at Socket.readFromStdout (/Users/pan/Desktop/energy_analysis/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:644:7)
    at Socket.emit (node:events:527:28)
    at addChunk (node:internal/streams/readable:315:12) {
  errors: [
    {
      detail: undefined,
      id: '',
      location: null,
      notes: [],
      pluginName: '',
      text: 'Two output files share the same path but have different contents: node_modules/.vite/deps_temp/Vue.js'
    }
  ],
  warnings: []
}