Meteor Galaxy部署 - 显示托管和无路由时的控制台错误

时间:2017-09-22 11:37:31

标签: jquery node.js meteor deployment routes

如上所述,当我的应用程序托管在Galaxy上时,我遇到了一个问题。我无法看到我网站的任何内容:

我只看到这个: My app says, that no routes are defined

但是我使用铁路由器定义了所有路由。我的import文件夹中有一些react-router的东西,也许这就是问题所在?我不知道......

此外,我收到以下错误消息:

  

混合内容:“https://myapp.eu.meteorapp.com/”的页面是   通过HTTPS加载,但请求不安全的样式表   'http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700'。   此请求已被阻止;内容必须通过HTTPS提供。

  

未捕获错误:Bootstrap的JavaScript需要jQuery版本1.9.1   或更高,但低于版本3       在21478a3d30e8f0ae766afe74c96bb1f3590793e6.js:115       在21478a3d30e8f0ae766afe74c96bb1f3590793e6.js:115       在21478a3d30e8f0ae766afe74c96bb1f3590793e6.js:115       在21478a3d30e8f0ae766afe74c96bb1f3590793e6.js:115

我正在使用Chrome浏览器。我只想看到任何东西......请

更新

我的所有路线都是这样的:

Router.route('/', function () {
    Router.go('home');
});

Router.route('/imprint', function () {
    this.render('imprint');
});

Router.route('/dashboard', function () {
    this.render('dashboard');
});

有时喜欢:

Router.route('/do/:home/editDetails/:Id', function () {
  var params = this.params;
  Session.set('home', params.home);
  Session.set('Id', params.Id);
  this.render('editDetails');
});

或同等学历。我正在使用流星铁路由器包。这是我的完整包文件:

meteor-base@1.1.0             # Packages every Meteor app needs to have
mongo@1.2.0                   # The database Meteor supports right now
blaze-html-templates    # Compile .html files into Meteor Blaze views
reactive-var@1.0.11            # Reactive variable for tracker
tracker@1.1.3                 # Meteor's client-side reactive programming library

standard-minifier-css@1.3.4   # CSS minifier run for production mode
standard-minifier-js@2.1.1    # JS minifier run for production mode
es5-shim@4.6.15                # ECMAScript 5 compatibility for older browsers
ecmascript@0.8.2              # Enable ECMAScript2015+ syntax in app code

kadira:blaze-layout     # Layout manager for blaze (works well with FlowRouter)
less@2.7.9                    # Leaner CSS language


practicalmeteor:mocha             # A package for writing and running your meteor app and package tests with mocha
johanbrook:publication-collector  # Test a Meteor publication by collecting its output


iron:router
zimme:iron-router-active
natestrauser:animate-css
kevohagan:sweetalert
chrismbeckett:toastr
fortawesome:fontawesome
session@1.1.7
logging@1.1.17
reload@1.1.11
random@1.0.10
ejson@1.0.14
spacebars
check@1.2.5
okgrow:router-autoscroll
joshdellay:meteor-ladda-bootstrap
d3js:d3
emdagon:c3js
andrasph:clockpicker
tsega:bootstrap3-datetimepicker

shell-server@0.2.4
http@1.2.12
peerlibrary:xml2js
meteorhacks:npm
json
jaredmartin:future

accounts-password@1.4.0
accounts-ui-unstyled@1.2.1
altapp:recaptcha
chart:chart
jackyqiu:meteor-jvectormap
jasny:bootstrap
meteorhacks:async
meteorhacks:ssr
mizzao:jquery-ui
mrgalaxy:stripe
mrt:footable

themeteorchef:bert
themeteorchef:jquery-validation
timmyg:wow
yagni:split-on-newlines
dynamic-import@0.1.1
alanning:roles
email@1.2.3
momentjs:moment
cosio55:autoform-cloudinary
aldeed:autoform
aldeed:collection2
nekojira:cloudinary-jquery-upload
allow-deny@1.0.6
cesarve:simple-chat
templating
ddp-rate-limiter

npm-container
mdg:validated-method
underscore
dburles:factory
practicalmeteor:chai
xolvio:cleaner
jquery

由于我使用了Boostrap-Theme,因此给出了meteor文件夹结构。因为我遇到了部署问题,所以我创建了一个带有--full标志的新流星项目,并将我的代码复制到其中。

一切正在使用localhost。

I have an import folder, with some code like:

import React from 'react';
import { render } from 'react-dom';
import { Router, Route, IndexRoute, browserHistory } from 'react-router';
import { Meteor } from 'meteor/meteor';
import App from '../../ui/layouts/App.js';
import Documents from '../../ui/pages/Documents.js';
import NewDocument from '../../ui/pages/NewDocument.js';
import EditDocument from '../../ui/containers/EditDocument.js';
import ViewDocument from '../../ui/containers/ViewDocument.js';
import Index from '../../ui/pages/Index.js';
import Login from '../../ui/pages/Login.js';
import NotFound from '../../ui/pages/NotFound.js';
import RecoverPassword from '../../ui/pages/RecoverPassword.js';
import ResetPassword from '../../ui/pages/ResetPassword.js';
import Signup from '../../ui/pages/Signup.js';

const authenticate = (nextState, replace) => {
  if (!Meteor.loggingIn() && !Meteor.userId()) {
    replace({
      pathname: '/login',
      state: { nextPathname: nextState.location.pathname },
    });
  }
};

Meteor.startup(() => {
  render(
    <Router history={ browserHistory }>
      <Route path="/" component={ App }>
        <IndexRoute name="index" component={ Index } />
        <Route name="documents" path="/documents" component={ Documents } onEnter={ authenticate } />
        <Route name="newDocument" path="/documents/new" component={ NewDocument } onEnter={ authenticate } />
        <Route name="editDocument" path="/documents/:_id/edit" component={ EditDocument } onEnter={ authenticate } />
        <Route name="viewDocument" path="/documents/:_id" component={ ViewDocument } onEnter={ authenticate } />
        <Route name="login" path="/login" component={ Login } />
        <Route name="recover-password" path="/recover-password" component={ RecoverPassword } />
        <Route name="reset-password" path="/reset-password/:token" component={ ResetPassword } />
        <Route name="signup" path="/signup" component={ Signup } />
        <Route path="*" component={ NotFound } />
      </Route>
    </Router>,
    document.getElementById('react-root')
  );
});

这可能会影响路由?当我创建新的--full项目时,我也在我的应用程序中自动加载了Flow-router软件包。我删除了包裹。但是,我正在使用Blaze和铁路由器。没有反应或流路由器。

非常感谢

1 个答案:

答案 0 :(得分:0)

解决:

我不知道确切的错误,但这不是路线本身的问题。我用我的代码绘制了一个完整的新项目并检查了每个文件。该错误必须与meteor包文件及其与npm相关的依赖关系做一些事情。一切都很好,直到我添加所有我需要的包。在我想启动应用程序后,它失败了,控制台说现在已经设置了npm,我应该重启应用程序。比npm-container在我的包文件中并且发生了“未找到路由”的事情。

但是,我使用了以前的版本,删除了软件包并逐个添加了我需要的软件包,现在它可以工作了。谢谢你的努力。