[英]my webpack cannot find my index.html page when I run npm start
[英]Whenever I start my app using `npm start` it brings me to the Ruby on Rails Homescreen instead of my index.html file
我是软件开发的新手,但我知道如何很好地使用React/Redux
,以及Ruby-On-Rails
。 我正在尝试让一个由 Rails 后端提供支持的 React 前端。 我从概念上理解Node.js
是如何工作的,但不完全是细节。 在我提交任何迁移之前,我的应用程序在开始阶段运行良好,因此在测试期间我从未运行过rails s.
现在,每当我这样做时,一旦我运行npm start
,它就会将我带到 Rails 主页,而我创建的任何代码都无处可去。 我以前创建过应用程序,但从未遇到过这个问题,而且我所知道的足以推测问题可能在于 src 目录中的packagae.json
文件,但除此之外我不知道该怎么做,也没有错误甚至谷歌。 我什至不知道我应该显示什么文件或代码......无论如何,这是我的 packagae.json 文件作为我的index.js
文件
{
"name": "legend_of_cliches",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-redux": "^7.2.4",
"react-scripts": "4.0.3",
"redux": "^4.1.1",
"redux-thunk": "^2.3.0",
"web-vitals": "^1.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import { Provider } from 'react-redux'
import { createStore, applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';
import masterReducer from './reducers/master_reducer';
// Sets up Store and Debuggers
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose
const store = createStore(masterReducer, composeEnhancers(applyMiddleware(thunk)))
ReactDOM.render(
<Provider store={store}>
<App />
</Provider>,
document.getElementById('root')
);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.