【问题标题】:Meteor Galaxy Deployment - Console errors while Hosting and no Routes are shownMeteor Galaxy 部署 - 托管时出现控制台错误且未显示路由
【发布时间】:2018-03-03 23:35:40
【问题描述】:

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

我只看到这个:

但我使用 Iron 路由器定义了所有路由。我的导入文件夹中有一些反应路由器的东西,也许这是问题?我不知道...

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

混合内容:位于“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 主题,因此给出了流星文件夹结构。因为我在部署时遇到了问题,所以我创建了一个带有 --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 和 Iron-router。没有反应或流量路由器。

非常感谢

【问题讨论】:

  • 那么,请告诉我们您的路线。很明显,有些东西不起作用。
  • 第二个错误来自meteor bootstrap包。我遇到了同样的问题并将其删除并通过 meteor npm install bootstrap 使用了 npm 包
  • 我做了一个很大的更新部分。 @Jankapunkt,我也这样做了,现在 JQuery 错误消息消失了,谢谢!

标签: jquery node.js meteor deployment routes


【解决方案1】:

已解决:

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-03
    • 2013-06-22
    • 1970-01-01
    • 1970-01-01
    • 2017-10-31
    • 2016-02-11
    相关资源
    最近更新 更多