我有一个运行Meteor框架+ React的应用程序。我尝试使用npm start命令启动应用程序,但我一直收到有关静态html文件的错误。我对meteor非常陌生,所以我尝试运行以下命令:
meteor remove static-html
meteor add blaze-html-templates但我还是收到了同样的错误...
=> 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.感谢您的帮助
发布于 2019-10-18 23:14:31
需要react和react-dom来呈现react组件
meteor npm install --save react react-dom您需要删除blaze add add static-html back。static-html用来呈现init html元素,然后react可以取代它。
meteor remove blaze-html-templates
meteor add static-htmlReact https://guide.meteor.com/react.html流星指南
https://stackoverflow.com/questions/58452953
复制相似问题