简体   繁体   English

ReactJS VS错误:未捕获的语法错误:意外的令牌

[英]ReactJS VS Error : Uncaught SyntaxError: Unexpected token <

I started learning REACT. 我开始学习REACT。 For starters I set up a local development environment and used sublime text as editor and started building small components. 首先,我建立了一个本地开发环境,并使用sublime文本作为编辑器,并开始构建小型组件。 Now I want to move onto ASP.net MVC 现在我要转到ASP.net MVC

I followed this tutorial till "Your First Component" but I got this error when I run the project 我遵循了教程,直到“您的第一个组件”,但是在运行项目时出现此错误

Uncaught SyntaxError: Unexpected token <

I searched this error and entered these 我搜索了此错误并输入了这些

type="text/babel"
type="text/jsx"

error gone but nothing displayed 错误消失但未显示任何内容

What's this error and how can this be resolved? 这是什么错误,如何解决?

my bad.... I install the wrong dependency(React.AspNet) from the NuGet Packages. 我的坏人...。我从NuGet软件包中安装了错误的依赖项(React.AspNet)。 I created the project again to ensure the problem wasn't from my side but (sigh) then I install React.Web.Mvc4 and it worked 我再次创建了项目,以确保问题出在我身边,但是(叹气)然后我安装了React.Web.Mvc4并成功了

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM