繁体   English   中英

如何解决找不到找不到模块'../home/featuredRooms'或其对应的类型声明。?

[英]how to solve cannot find Cannot find module '../home/featuredRooms' or its corresponding type declarations.?

当我将我的网站部署到 netlify 或 vercel 时,我遇到了这个奇怪的错误,但是这个项目在我的计算机上正常运行。 我正在使用 typescript 和下一个 js。 我还尝试将文件夹重命名为小写

这是 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

您在文件系统中的实际路径是../Home/featuredRooms

您很可能在本地使用 macOS 设备,其中路径不区分大小写,因此不会出现问题。 但是,当部署到您的托管服务 Linux 机器时使用区分大小写的路径,因此../home/featuredRooms将无效。

作为一般经验法则,我建议您始终使用小写文件夹/文件名来避免此类问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM