如何修复 NextJS 问题?
How to fix NextJS enoent?
你们知道什么可能导致这个错误吗?帮助将不胜感激。
这个错误突然开始,无法弄清楚为什么。
我找到的与此主题相关的任何来源也没有帮助,例如 npm clear cache 等
error - uncaughtException: Error: ENOENT: no such file or directory, open 'C:\Users\merth\Documents\GitHub\nextjs\.next\cache\images\dGhpP2cdrThITYfJW5zYTASPDxgkrHRsKGV+DHjA9zg=[=10=].1644007067863.49adoDywz9oh2itwLAOxco3SX+8Yk8UjPaOwcMHXKIw=.webp'
error - uncaughtException: Error: ENOENT: no such file or directory, open 'C:\Users\merth\Documents\GitHub\nextjs\.next\cache\imagesXzO9vkSresQcu4SX685Pbl3Cb8+GLnoRVSy6EWXt5Y=[=10=].1644007067864.yV8JGEcK4N5RHfOP1YCy50EVKU0ZtA8shhISYdcO9cQ=.webp'
error - uncaughtException: Error: ENOENT: no such file or directory, open 'C:\Users\merth\Documents\GitHub\nextjs\.next\cache\images\P0c16eKt464UeqAGlMPK9QsWSCanffokfdynMp877IQ=[=10=].1644007067876.CuEqtaf2wyvhSmvWM7JEkbGjhFFUEs9KqFQ-2+tjghc=.webp'
error - uncaughtException: Error: ENOENT: no such file or directory, open 'C:\Users\merth\Documents\GitHub\nextjs\.next\cache\images\-Q0UZI-9z63T0kTLDD9WriKzJMRU4ezA+i4LmDQDXlM=[=10=].1644007067831.UiZIuijWkV1W07Pfo02XjEvnKc-DlxzW0O3wLCqz-hM=.webp'
error - uncaughtException: Error: ENOENT: no such file or directory, open 'C:\Users\merth\Documents\GitHub\nextjs\.next\cache\images\INra01gHa2-vzBW63AhvPMn+t5fHxh8cp5pivirhiRA=[=10=].1644007067837.NvV+tAwZT5uhgQUBvxIUsk1gLqUnDgarmgOlSAv2Oos=.webp'
error - uncaughtException: Error: ENOENT: no such file or directory, open 'C:\Users\merth\Documents\GitHub\nextjs\.next\cache\imagesIOk0AWjSzsxeWX3JUtAxUOeibv3HkY1OaLS3xWD1P0=[=10=].1644007067823.BNmZ25sRS8r8aebBo4tpl77uOHrZp-hK7huYDJCA2YI=.webp'
我的一些图像组件;
<figure className='w-full h-full overflow-hidden bg-white rounded-sm lg:rounded-r-none'>
<div className='relative w-full h-full transition-transform lg:group-hover:scale-105 transform-gpu'>
{props.page.card.thumbnail && (
<>
<Image
layout='fill'
// width={752}
// height={490}
objectFit='cover'
objectPosition='center'
src={props.page.card.thumbnail}
alt={
props.page.card.title &&
props.page.card.title[props.locale]
}
loading='lazy'
placeholder='blur'
blurDataURL={props.page.card.thumbnail}
quality={75}
/>
</>
)}
</div>
</figure>
--
"dependencies": {
"@google/model-viewer": "^1.10.1",
"@tailwindcss/aspect-ratio": "^0.4.0",
"@tailwindcss/forms": "^0.4.0",
"@tailwindcss/line-clamp": "^0.3.1",
"autoprefixer": "^10.4.2",
"eslint": "7.32.0",
"eslint-config-next": "^0.2.4",
"js-cookie": "^3.0.1",
"next": "^12.0.10",
"nprogress": "^0.2.0",
"postcss": "^8.4.5",
"react": "^17.0.2",
"react-accessible-accordion": "^4.0.0",
"react-dom": "^17.0.2",
"react-share": "^4.4.0",
"react-social-icons": "^5.10.0",
"serverless-mysql": "^1.5.4",
"sharp": "^0.30.0",
"swr": "^1.2.1",
"tailwindcss": "^3.0.13",
"tailwindcss-animation-delay": "^1.0.7"
},
尝试将“下一步”还原为 12.0.9
"next": "^12.0.9",
我遇到了同样的问题,就我而言,我只是尝试一下:
PS. this fix is not permanent, this is just a stopgap solution
-
- 停止本地服务器
-
- 删除文件夹
.next
-
- 运行
yarn dev
(我在项目中使用了 Yarn 包)
好了,问题解决了。
你们知道什么可能导致这个错误吗?帮助将不胜感激。 这个错误突然开始,无法弄清楚为什么。 我找到的与此主题相关的任何来源也没有帮助,例如 npm clear cache 等
error - uncaughtException: Error: ENOENT: no such file or directory, open 'C:\Users\merth\Documents\GitHub\nextjs\.next\cache\images\dGhpP2cdrThITYfJW5zYTASPDxgkrHRsKGV+DHjA9zg=[=10=].1644007067863.49adoDywz9oh2itwLAOxco3SX+8Yk8UjPaOwcMHXKIw=.webp'
error - uncaughtException: Error: ENOENT: no such file or directory, open 'C:\Users\merth\Documents\GitHub\nextjs\.next\cache\imagesXzO9vkSresQcu4SX685Pbl3Cb8+GLnoRVSy6EWXt5Y=[=10=].1644007067864.yV8JGEcK4N5RHfOP1YCy50EVKU0ZtA8shhISYdcO9cQ=.webp'
error - uncaughtException: Error: ENOENT: no such file or directory, open 'C:\Users\merth\Documents\GitHub\nextjs\.next\cache\images\P0c16eKt464UeqAGlMPK9QsWSCanffokfdynMp877IQ=[=10=].1644007067876.CuEqtaf2wyvhSmvWM7JEkbGjhFFUEs9KqFQ-2+tjghc=.webp'
error - uncaughtException: Error: ENOENT: no such file or directory, open 'C:\Users\merth\Documents\GitHub\nextjs\.next\cache\images\-Q0UZI-9z63T0kTLDD9WriKzJMRU4ezA+i4LmDQDXlM=[=10=].1644007067831.UiZIuijWkV1W07Pfo02XjEvnKc-DlxzW0O3wLCqz-hM=.webp'
error - uncaughtException: Error: ENOENT: no such file or directory, open 'C:\Users\merth\Documents\GitHub\nextjs\.next\cache\images\INra01gHa2-vzBW63AhvPMn+t5fHxh8cp5pivirhiRA=[=10=].1644007067837.NvV+tAwZT5uhgQUBvxIUsk1gLqUnDgarmgOlSAv2Oos=.webp'
error - uncaughtException: Error: ENOENT: no such file or directory, open 'C:\Users\merth\Documents\GitHub\nextjs\.next\cache\imagesIOk0AWjSzsxeWX3JUtAxUOeibv3HkY1OaLS3xWD1P0=[=10=].1644007067823.BNmZ25sRS8r8aebBo4tpl77uOHrZp-hK7huYDJCA2YI=.webp'
我的一些图像组件;
<figure className='w-full h-full overflow-hidden bg-white rounded-sm lg:rounded-r-none'>
<div className='relative w-full h-full transition-transform lg:group-hover:scale-105 transform-gpu'>
{props.page.card.thumbnail && (
<>
<Image
layout='fill'
// width={752}
// height={490}
objectFit='cover'
objectPosition='center'
src={props.page.card.thumbnail}
alt={
props.page.card.title &&
props.page.card.title[props.locale]
}
loading='lazy'
placeholder='blur'
blurDataURL={props.page.card.thumbnail}
quality={75}
/>
</>
)}
</div>
</figure>
--
"dependencies": {
"@google/model-viewer": "^1.10.1",
"@tailwindcss/aspect-ratio": "^0.4.0",
"@tailwindcss/forms": "^0.4.0",
"@tailwindcss/line-clamp": "^0.3.1",
"autoprefixer": "^10.4.2",
"eslint": "7.32.0",
"eslint-config-next": "^0.2.4",
"js-cookie": "^3.0.1",
"next": "^12.0.10",
"nprogress": "^0.2.0",
"postcss": "^8.4.5",
"react": "^17.0.2",
"react-accessible-accordion": "^4.0.0",
"react-dom": "^17.0.2",
"react-share": "^4.4.0",
"react-social-icons": "^5.10.0",
"serverless-mysql": "^1.5.4",
"sharp": "^0.30.0",
"swr": "^1.2.1",
"tailwindcss": "^3.0.13",
"tailwindcss-animation-delay": "^1.0.7"
},
尝试将“下一步”还原为 12.0.9
"next": "^12.0.9",
我遇到了同样的问题,就我而言,我只是尝试一下:
PS. this fix is not permanent, this is just a stopgap solution
-
- 停止本地服务器
-
- 删除文件夹
.next
- 删除文件夹
-
- 运行
yarn dev
(我在项目中使用了 Yarn 包)
- 运行
好了,问题解决了。