gpt4 book ai didi

Next JS 13 App Project is very slow to save file and showing intellisense suggestions in VS Code(下一个JS 13应用程序项目保存文件和在VS代码中显示智能感知建议的速度非常慢)

转载 作者:bug小助手 更新时间:2023-10-25 17:54:40 28 4
gpt4 key购买 nike



I had this issue when developing a project of Next JS 13 app stable version in VS Code. The longer I run my app in dev mode the longer it takes for save, for intellicode to loads suggestions, also for prettier and eslint to auto format.

当我在VS Code中开发下一个JS13应用程序稳定版本的项目时,我遇到了这个问题。我在开发模式下运行应用程序的时间越长,保存、智能代码加载建议、更美观和eslint到自动格式的时间就越长。


Example case:

案例示例:



  1. I stay and edits many times in one page.tsx file, which means nextjswill compile many times as well.

  2. As time goes on, the slow loading of saving and formatting comes up.

  3. The slow loading comes up more clear especially after I move to another file

  4. In the end I tried to restart VSCode and run dev again.

  5. At beginning after restart everything goes fine, but as time goes on... back to point number 1.


This is very strange bug because only in this Next JS 13 app project that the lags happen. Meanwhile I also opened other project like React project and Next JS 13 pages project, these projects run just fine.

这是一个非常奇怪的错误,因为只有在下一个JS13应用程序项目中才会出现滞后。同时,我还打开了其他项目,如反应项目和下一个JS 13页项目,这些项目运行得很好。


For now still not yet found the solution, already tried to add .next in tsconfig and disabling extension just as the github community suggested, but lag still occurs.

目前还没有找到解决方案,已经尝试在tsconfig中添加.Next并禁用扩展,就像GitHub社区建议的那样,但仍然会出现滞后。


更多回答

Did you try deleting the .next folder?

您是否尝试删除.Next文件夹?

I've tried to delete .next folder yet still facing the issue

我已尝试删除.Next文件夹,但仍面临问题

优秀答案推荐

I decided to experiment with Next.js 13.4 to see if it would be a good fit for my project. In a simple React Vite app, I had a basic form that worked perfectly fine. However, after recreating it in Next.js, the development mode became extremely slow. As you mentioned, even the compilation time for Prettier takes a significant amount of time. I have been unable to find a solution thus far (I tried some solutions like uninstalling some packages etc., but no luck).

我决定使用Next.js 13.4进行实验,看看它是否适合我的项目。在一个简单的Reaction Vite应用程序中,我有一个工作得非常好的基本表单。然而,在Next.js中重新创建它后,开发模式变得极其缓慢。正如您所提到的,即使是编译SPECTER也需要相当长的时间。到目前为止,我一直无法找到解决方案(我尝试了一些解决方案,如卸载一些包等,但没有运气)。


The closest thing I found that relates to this issue is this GitHub thread without a solution: https://github.com/vercel/next.js/issues/48748

我找到的与这个问题最相关的东西是这个没有解决方案的gihub线程:https://github.com/vercel/next.js/issues/48748


If you happen to discover a solution to this problem in the future, I would greatly appreciate it if you could share it here.

如果你将来碰巧发现了这个问题的解决方案,如果你能在这里分享,我将不胜感激。



The solution is in this link

解决方案在此链接中


https://github.com/vercel/next.js/discussions/50417

Https://github.com/vercel/next.js/discussions/50417


"I had this issue with prettier-plugin-tailwindcss version 0.3, downgrading it back to say 0.2.1 with npm install --save-dev prettier-plugin-tail[email protected] and restarting VSCode solve the issue for me"

我在0.3版中遇到了这个问题,在NPM安装时将其降级到0.2.1,保存-开发-插件尾部[电子邮件受保护],然后重新启动VSCode为我解决了这个问题。


更多回答

After reading some suggestions from this thread: github.com/vercel/next.js/discussions/… I try to uninstall prettier-plugin-tailwindcss package and luckily my project is working smoothly now

在阅读了这个帖子中的一些建议后:githeb.com/Vercel/next.js/Discestions/…我试着卸载更漂亮的插件尾随程序包,幸运的是,我的项目现在运行顺利

Thanks, I tried that also, but no luck. I started again with the 13.4.7 with a clean project without any packages like prettier, it's a little better, but still when I spend much time in app development mode, it starts to slow down. I don't know, but I think I miss React Vite development.

谢谢,我也试过了,但没成功。我重新开始了13.4.7,没有任何像Pretier这样的包,但当我花很多时间在应用程序开发模式下时,它开始变慢。我不知道,但我想我怀念反应和发展。

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

正如它目前所写的,你的答案并不清楚。请编辑以添加更多详细信息,以帮助其他人了解这是如何解决提出的问题的。你可以在帮助中心找到更多关于如何写出好答案的信息。

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com