简体   繁体   English

找不到模块:错误:无法解析“/opt/build/repo/src”中的“./components/Scrolltotop”

[英]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.

相关问题 找不到模块:错误:无法解析“/opt/build/repo/src”中的“./components/layouts/Navbar” - Module not found: Error: Can't resolve './components/layouts/Navbar' in '/opt/build/repo/src' 将应用程序部署到 Netlify:找不到模块:错误:无法解析 '/opt/build/repo/src' 中的 './pages/HomePage' - React app deployment to Netlify : Module not found: Error: Can't resolve './pages/HomePage' in '/opt/build/repo/src' Gatsby Netlify 构建错误:无法解析“/opt/build/repo/src/templates”中的“../components/GridTemplate/GridTemplate.js” - Gatsby Netlify build error: Can't resolve '../components/GridTemplate/GridTemplate.js' in '/opt/build/repo/src/templates' 在 .netlify 上部署我的 React 项目时显示错误:无法在 '/opt/build/repo/src/components/header' 中解析 '../../assets/CV.pdf' - while deploying my react project on netlify showing error: Can't resolve '../../assets/CV.pdf' in '/opt/build/repo/src/components/header' 放大 React 构建失败,显示“未找到模块:错误:无法解析‘/codebuild/output/src313005886/src/client-portal/src’中的‘./components/...’” - Amplify React build fail with "Module not found: Error: Can't resolve './components/...' in '/codebuild/output/src313005886/src/client-portal/src' " Heroku 错误:找不到模块:错误:无法解析“.../src/main/js/components”中的“React” - Heroku Error: Module not found: Error: Can't resolve 'React' in '.../src/main/js/components 找不到模块:错误:无法在“/home/yusquen/Projectss/react-shop/src/components”中解析“../containers/Layout” - Module not found: Error: Can't resolve '../containers/Layout' in '/home/yusquen/Projectss/react-shop/src/components' ./src/components/index.js找不到模块:无法解析“ / src / components”中的“ ./{Component}” - ./src/components/index.js Module not found: Can't resolve './{Component}' in '/src/components' 找不到输入模块中的错误:错误:无法解析“ ./src” - ERROR in Entry module not found: Error: Can't resolve './src' in 找不到输入模块:错误:无法解析“ ./src” - Entry module not found: Error: Can't resolve './src'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM