首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >启动Meteor应用程序+ react时出错(static-html)

启动Meteor应用程序+ react时出错(static-html)
EN

Stack Overflow用户
提问于 2019-10-18 22:32:13
回答 1查看 201关注 0票数 0

我有一个运行Meteor框架+ React的应用程序。我尝试使用npm start命令启动应用程序,但我一直收到有关静态html文件的错误。我对meteor非常陌生,所以我尝试运行以下命令:

代码语言:javascript
复制
meteor remove static-html
meteor add blaze-html-templates

但我还是收到了同样的错误...

代码语言:javascript
复制
=> Errors prevented startup:                  

   While processing files with static-html (for target web.browser):
   deploy/bundle/programs/web.browser/body.html:1: Expected one of: <body>, <head>, <template>
   deploy/bundle/programs/web.browser/head.html:1: Expected one of: <body>, <head>, <template>
   deploy/bundle/programs/web.browser.legacy/body.html:1: Expected one of: <body>, <head>, <template>
   deploy/bundle/programs/web.browser.legacy/head.html:1: Expected one of: <body>, <head>, <template>

   While processing files with static-html (for target web.browser.legacy):
   deploy/bundle/programs/web.browser/body.html:1: Expected one of: <body>, <head>, <template>
   deploy/bundle/programs/web.browser/head.html:1: Expected one of: <body>, <head>, <template>
   deploy/bundle/programs/web.browser.legacy/body.html:1: Expected one of: <body>, <head>, <template>
   deploy/bundle/programs/web.browser.legacy/head.html:1: Expected one of: <body>, <head>, <template>

=> Your application has errors. Waiting for file change.

感谢您的帮助

EN

回答 1

Stack Overflow用户

发布于 2019-10-18 23:14:31

需要reactreact-dom来呈现react组件

代码语言:javascript
复制
meteor npm install --save react react-dom

您需要删除blaze add add static-html back。static-html用来呈现init html元素,然后react可以取代它。

代码语言:javascript
复制
meteor remove blaze-html-templates
meteor add static-html

React https://guide.meteor.com/react.html流星指南

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58452953

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档