When I import static images with no issues using npm run dev
, everything runs smoothly.
However, when attempting to utilize npm run build
or next build
, it fails and prevents deployment to 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
Upon running npm run dev/next build:
Failed to compile.
HookWebpackError: File E:\Github\Project\.next\static\media\IMG_1764.59cd3605.JPG does not exist.
at makeWebpackError (E:\Github\Project\node_modules\next\dist\compiled\webpack\bundle5.js:28:308185)
at E:\Github\Project\node_modules\next\dist\compiled\webpack\bundle5.js:28:105236
at eval (eval at create (E:\Github\Project\node_modules\next\dist\compiled\webpack\bundle5.js:13:28771), <anonymous>:27:1)
at E:\Github\Project\node_modules\next\dist\compiled\webpack\bundle5.js:28:68649
at E:\Github\Project\node_modules\next\dist\build\webpack\plugins\next-trace-entrypoints-plugin.js:437:143
-- inner error --
Error: File E:\Github\Project\.next\static\media\IMG_1764.59cd3605.JPG does not exist.
at Job.emitDependency (E:\Github\Project\node_modules\next\dist\compiled\@vercel\nft\index.js:1:39473)
at async Promise.all (index 10)
at async Object.nodeFileTrace (E:\Github\Project\node_modules\next\dist\compiled\@vercel\nft\index.js:1:35430)
at async E:\Github\Project\node_modules\next\dist\build\webpack\plugins\next-trace-entrypoints-plugin.js:136:28
at async Span.traceAsyncFn (E:\Github\Project\node_modules\next\dist\trace\trace.js:79:20)
at async TraceEntryPointsPlugin.createTraceAssets (E:\Github\Project\node_modules\next\dist\build\webpack\plugins\next-trace-entrypoints-plugin.js:90:9)
caused by plugins in Compilation.hooks.processAssets
Error: File E:\Github\Project\.next\static\media\IMG_1764.59cd3605.JPG does not exist.
at Job.emitDependency (E:\Github\Project\node_modules\next\dist\compiled\@vercel\nft\index.js:1:39473)
at async Promise.all (index 10)
at async Object.nodeFileTrace (E:\Github\Project\node_modules\next\dist\compiled\@vercel\nft\index.js:1:35430)
at async E:\Github\Project\node_modules\next\dist\build\webpack\plugins\next-trace-entrypoints-plugin.js:136:28
at async Span.traceAsyncFn (E:\Github\Project\node_modules\next\dist\trace\trace.js:79:20)
at async TraceEntryPointsPlugin.createTraceAssets (E:\Github\Project\node_modules\next\dist\build\webpack\plugins\next-trace-entrypoints-plugin.js:90:9)
Upon trying to build, the command npm run dev
stops functioning and displays an error message.