[英]Module not found: Error: Can't resolve './components/Scrolltotop' in '/opt/build/repo/src'
I am trying to deploy my site to.netlify but i keep getting this error我正在尝试将我的网站部署到 .netlify,但我一直收到此错误
Module not found: Error: Can't resolve './components/Scrolltotop' in '/opt/build/repo/src'找不到模块:错误:无法解析“/opt/build/repo/src”中的“./components/Scrolltotop”
i dont have this import statement anywhere in my code.我的代码中的任何地方都没有这个导入语句。 Screenshot截屏
This is my import statement这是我的进口声明
On my localhost server i am not getting any error.在我的本地主机服务器上,我没有收到任何错误。 Why is the deployment failing?为什么部署失败?
UPDATE I have corrected the filename casing in github ie from Scrolltotop.js to ScrollToTop.js but the error is not gone更新我已经更正了 github 中的文件名大小写,即从 Scrolltotop.js 到 ScrollToTop.js 但错误并没有消失
I have the same type of error do not hesitate to report it if you have found the solution:)我有相同类型的错误,如果您找到解决方案,请不要犹豫,报告它:)
Console ===== Module not found: Error: Can't resolve 'js-cookie' in '/opt/build/repo/src/components/Log'控制台 ===== 未找到模块:错误:无法解析 '/opt/build/repo/src/components/Log' 中的 'js-cookie'
What Solved it for me was to move the folder up a directory.为我解决的是将文件夹向上移动一个目录。 I simply changed the location of the folder and did a git push.我只是更改了文件夹的位置并进行了 git 推送。 You could also try renaming the folder and do a git push.您也可以尝试重命名该文件夹并进行 git 推送。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.