首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何修复NextJS?

如何修复NextJS?
EN

Stack Overflow用户
提问于 2022-02-04 21:04:20
回答 2查看 3.5K关注 0票数 2

你们知道是什么导致了这个错误吗?我们会非常感谢你的帮助。此错误突然启动,无法解释原因。我找到的任何与这个主题相关的资源也没有帮助,比如npm清除缓存等。

代码语言:javascript
复制
error - uncaughtException: Error: ENOENT: no such file or directory, open 'C:\Users\merth\Documents\GitHub\nextjs\.next\cache\images\dGhpP2cdrThITYfJW5zYTASPDxgkrHRsKGV+DHjA9zg=\0.1644007067863.49adoDywz9oh2itwLAOxco3SX+8Yk8UjPaOwcMHXKIw=.webp'
error - uncaughtException: Error: ENOENT: no such file or directory, open 'C:\Users\merth\Documents\GitHub\nextjs\.next\cache\images\4XzO9vkSresQcu4SX685Pbl3Cb8+GLnoRVSy6EWXt5Y=\0.1644007067864.yV8JGEcK4N5RHfOP1YCy50EVKU0ZtA8shhISYdcO9cQ=.webp'
error - uncaughtException: Error: ENOENT: no such file or directory, open 'C:\Users\merth\Documents\GitHub\nextjs\.next\cache\images\P0c16eKt464UeqAGlMPK9QsWSCanffokfdynMp877IQ=\0.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=\0.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=\0.1644007067837.NvV+tAwZT5uhgQUBvxIUsk1gLqUnDgarmgOlSAv2Oos=.webp'
error - uncaughtException: Error: ENOENT: no such file or directory, open 'C:\Users\merth\Documents\GitHub\nextjs\.next\cache\images\5IOk0AWjSzsxeWX3JUtAxUOeibv3HkY1OaLS3xWD1P0=\0.1644007067823.BNmZ25sRS8r8aebBo4tpl77uOHrZp-hK7huYDJCA2YI=.webp'

我的一些图像组件;

代码语言:javascript
复制
<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>

--

代码语言:javascript
复制
"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"
    },
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2022-02-05 03:57:27

尝试将“下一步”恢复到12.0.9

代码语言:javascript
复制
"next": "^12.0.9",

解决方案来自这里,https://github.com/vercel/next.js/issues/33860

票数 3
EN

Stack Overflow用户

发布于 2022-04-08 01:15:44

我也会遇到同样的问题,在我的例子中,我只是尝试一下:

PS. this fix is not permanent, this is just a stopgap solution

    • Stop局部Server

    • Delete文件夹.next

    • Run yarn dev (我在project)

中使用纱包)

问题解决了。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70992824

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档