部署到Heroku:找不到模块(不区分大小写的问题) [英] Deploying to Heroku: Module not found (not case-sensitive issue)
问题描述
我正在尝试部署使用create-react-app创建的应用。
该应用程序既可以在本地 npm start 和 npm run build 上运行,但在部署到Heroku时却为我的ActionCreators提供了一个模块未找到错误:
I'm trying to deploy an app that was created with create-react-app. The app works both as npm start and npm run build locally, but gives a module not found error for my ActionCreators when deployed to Heroku:
区分大小写不是问题,我已经检查过,因为通常这是错误。我还把devDependencies置于依赖项下,因为这是我遇到的另一个错误。
Case sensitivity is not an issue, I have checked, as that is usually the error. I have also put the devDependencies under dependencies as that was another error I had.
我的动作创建者导出为:
My action creator are exported as:
export const newProjectCreated = newProject => ({
type: 'PROJECT_CREATED',
newProject
});
export const projectDeleted = deletedProject => ({
type: 'PROJECT_DELETED',
deletedProject
});
并导入为
import * as ActionCreators from '../Actions/ActionCreators';
难道是Heroku不喜欢这种进口吗?
Can it be that Heroku doesn't like this kind of import? What else could be going wrong?
我感谢任何输入!
推荐答案
我找到了答案:
这是一个区分大小写的问题。问题是我不知道GIT不在文件中寻找区分大小写的更改。
It WAS a case-sensitive issue. The problem is that I didn't know that GIT is not looking for case-sensitive changes in the file.
在调试时,我清理了文档并大写了一个文件,以使所有内容保持一致。我的项目树显示了一个已更改的文件,但我推送的git仍然是带有小写字母的文件。
While I was debugging I cleaned up the document and capitalized one file, so that everything is consistent. My project-tree showed a changed file but the git I was pushing was still the one with a small letter.
这篇关于部署到Heroku:找不到模块(不区分大小写的问题)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!