简体   繁体   English

我正在尝试在我的服务器上运行我的新反应项目

[英]I'm trying to run my new react project on my server

Every time run my project:每次运行我的项目:

import React from 'react';
import ReactDom from 'react-dom'; 

import App from './App.js '


ReactDom.render(<App />, document.querySelector('#root'));

it keeps bringing back this error Failed to compile.它不断带回此错误无法编译。

I've also reinstalled react-dom我还重新安装了react-dom

but it Doesn't work.但它不起作用。

You can try two things :你可以尝试两件事:
First, replace ./App.js by only App首先,仅将./App.js替换为App
Second, I don't know if a space can fail your import but it looks like you have one on your import.其次,我不知道一个空间是否会使您的导入失败,但看起来您的导入中有一个空间。

Are you sure './App.js' is the right path of the App component?您确定 './App.js' 是 App 组件的正确路径吗? Because it is not being found on this path.因为在这条路径上找不到它。

暂无
暂无

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

相关问题 我正在尝试将 JavaScript 数据发送到我的 NodeJS 服务器 - I'm trying to send JavaScript data to my NodeJS server 尝试将页面添加到项目时,我在命令提示符下收到此错误500 - I'm getting this error 500 on my command prompt when trying to add a page to my project 在一个项目中同时使用Node js和react时,会发生服务端渲染吗? 我是新手 - When Node js and react are used in a project at the same time, does server side rendering happen? I'm new to this 我正在尝试通过 express 为我的 React 应用程序提供服务,为什么我会收到 404? - I'm trying to serve my react app from express, why am I getting a 404? 为什么当我尝试运行服务器 gRPC 时出现此错误? - why i'm i getting this error when i try to run my server gRPC? 在 2 人使用我的 discord 机器人对 discord 消息做出反应后,我正在尝试发送消息 - I'm trying to send a message after 2 persons react to a discord message using my discord bot 我正在尝试将 base64 编码的字符串转换为我的反应文件上的图像 - I'm trying to convert a base64 encoded string to a image on my react file 尝试运行节点服务器时出现未处理的错误 - I'm getting an unhandled error when trying to run node server 我正在尝试显示我用multer上传到我后端的图像 - I'm trying to display images that I uploaded to my backend with multer 动态站点需要什么 Browsersync 代理设置,我正在尝试运行我的 app.js 文件但页面超时 - What are the Browsersync proxy settings needed for a dynamic site, i'm trying to run my app.js file but the page times out
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM