Webpack在Nextjs中找不到图像



我正在导入一些静态图像npm run dev

但是当我尝试使用npm run buildnext build它失败了,我甚至无法将它部署到vercel

next info
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Home
Binaries:
Node: 16.14.2
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant packages:        
next: 13.1.1
eslint-config-next: N/A 
react: 18.2.0
react-dom: 18.2.0  

npm运行dev/next build:

Failed to compile.
HookWebpackError: File E:GithubProject.nextstaticmediaIMG_1764.59cd3605.JPG does not exist.
at makeWebpackError (E:GithubProjectnode_modulesnextdistcompiledwebpackbundle5.js:28:308185)
at E:GithubProjectnode_modulesnextdistcompiledwebpackbundle5.js:28:105236
at eval (eval at create (E:GithubProjectnode_modulesnextdistcompiledwebpackbundle5.js:13:28771), <anonymous>:27:1)
at E:GithubProjectnode_modulesnextdistcompiledwebpackbundle5.js:28:68649
at E:GithubProjectnode_modulesnextdistbuildwebpackpluginsnext-trace-entrypoints-plugin.js:437:143
-- inner error --
Error: File E:GithubProject.nextstaticmediaIMG_1764.59cd3605.JPG does not exist.
at Job.emitDependency (E:GithubProjectnode_modulesnextdistcompiled@vercelnftindex.js:1:39473)
at async Promise.all (index 10)
at async Object.nodeFileTrace (E:GithubProjectnode_modulesnextdistcompiled@vercelnftindex.js:1:35430)
at async E:GithubProjectnode_modulesnextdistbuildwebpackpluginsnext-trace-entrypoints-plugin.js:136:28
at async Span.traceAsyncFn (E:GithubProjectnode_modulesnextdisttracetrace.js:79:20)
at async TraceEntryPointsPlugin.createTraceAssets (E:GithubProjectnode_modulesnextdistbuildwebpackpluginsnext-trace-entrypoints-plugin.js:90:9)
caused by plugins in Compilation.hooks.processAssets
Error: File E:GithubProject.nextstaticmediaIMG_1764.59cd3605.JPG does not exist.
at Job.emitDependency (E:GithubProjectnode_modulesnextdistcompiled@vercelnftindex.js:1:39473)
at async Promise.all (index 10)
at async Object.nodeFileTrace (E:GithubProjectnode_modulesnextdistcompiled@vercelnftindex.js:1:35430)
at async E:GithubProjectnode_modulesnextdistbuildwebpackpluginsnext-trace-entrypoints-plugin.js:136:28
at async Span.traceAsyncFn (E:GithubProjectnode_modulesnextdisttracetrace.js:79:20)
at async TraceEntryPointsPlugin.createTraceAssets (E:GithubProjectnode_modulesnextdistbuildwebpackpluginsnext-trace-entrypoints-plugin.js:90:9)

一旦我试图构建我的npm run dev就不再工作了,并说

我也有同样的错误。将以JPG结尾的文件更改为jpg

相关内容

  • 没有找到相关文章

最新更新