[英]how to solve cannot find Cannot find module '../home/featuredRooms' or its corresponding type declarations.?
I am getting this weird error,when i deploy my site to netlify or vercel, but this project runs correctly in my computer.当我将我的网站部署到 netlify 或 vercel 时,我遇到了这个奇怪的错误,但是这个项目在我的计算机上正常运行。 I am using typescript with next js.
我正在使用 typescript 和下一个 js。 I Also tried to rename folders to lowercase
我还尝试将文件夹重命名为小写
Here is the github link:- https://github.com/Sumukha210/hotel-booking这是 github 链接:- https://github.com/Sumukha210/hotel-booking
Error occurred prerendering page "/gallery". Read more:
https://nextjs.org/docs/messages/prerender-error
23:50:55.380 TypeError: pathname.replaceAll is not a function
Your actual path in the file system is ../Home/featuredRooms
.您在文件系统中的实际路径是
../Home/featuredRooms
。
You're most likely using a macOS device locally, where paths are case-insensitive so no issues occur.您很可能在本地使用 macOS 设备,其中路径不区分大小写,因此不会出现问题。 However, when deployed to your hosting services Linux machines with case-sensitive paths are used, so
../home/featuredRooms
will not be valid.但是,当部署到您的托管服务 Linux 机器时使用区分大小写的路径,因此
../home/featuredRooms
将无效。
As a general rule of thumb I'd suggest you always use lowercase folder/file names to avoid these kind of issues.作为一般经验法则,我建议您始终使用小写文件夹/文件名来避免此类问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.