英文:
Static files not accessible - NextJS Plesk .js/.css extension changed to .jsundefined/.cssundefined
问题
我在Plesk服务器上部署了一个NextJS应用。之前它正常运行,我在布局中做了一些更改并推送了更新,从那时起,新版本和备份都无法正常工作。
错误显示静态文件(JS和CSS)不可用,并显示404错误。导致这个错误的原因是它在所有URL的末尾添加了undefined
,我不知道它是从哪里来的,我找不到类似的情况。因此,所有CSS和JS文件的扩展名都变成了.cssundefined
和.jsundefined
,从URL中移除undefined
可以正常工作,并且文件的内容在浏览器中打开。
我一直在使用next build
命令,以前配置都正常。而且,更改仅涉及布局文件,只与少数布局元素相关。
相同的代码在本地主机上正常工作,无论是在开发模式还是生产模式下。
你可以在NextJS的Github存储库上找到我提出的问题链接在这里。
英文:
I've a NextJS app deployed on Plesk server. It was working properly, I changed something in layout and pushed an update, since then, neither the new nor the backup is working.
The error states that the static files (JS and CSS) files are not available and gives a 404 error. The reason for this error is it's adding undefined
at the end of all the URLs and I've no clue where is it coming from, I've found nothing similar to this one. Because of this, all CSS and JS files' extensions have changed to .cssundefined
and .jsundefined
, removing the undefined
from the url works and the file's content opens in the browser.
I've been using the command next build
and it was working with the same config properly. Also, the changes were only in a layout file, related to only few layout elements.
The same code is working properly at localhost, in both development and production mode.
You can find the issue I've filed on NextJS's Github repo here.
答案1
得分: 0
这个问题与 NextJS 的版本 13.2.4
和 13.2.5
有关,与我的代码无关。
在 NextJS 的官方存储库上提出讨论后,提供的解决方案是在你的 package.json
文件中将 NextJS 版本降级并锁定为 13.2.1
。
你可以在这里找到提供的解决方案。
PS:他们预计会出现这个问题的 bug 浪潮。
英文:
The issue is related to NextJS's versions 13.2.4
and 13.2.5
and not related to my code.
After filing a discussion thread on the official repository of NextJS, the solution provided is to downgrade and lock your NextJS version to 13.2.1
in your package.json
file.
You can find the solution provided here.
PS: They're expecting a bug wave for this.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论