首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >流星Ionic2

流星Ionic2
EN

Stack Overflow用户
提问于 2016-11-22 12:48:44
回答 1查看 327关注 0票数 0

在Ionic2项目中使用Meteor有问题。项目本身应该运行,因为它是Meteor-教程:git clone https://github.com/Urigo/Ionic2CLI-Meteor-WhatsApp的克隆。

当我启动Meteor服务器时,我得到以下信息

代码语言:javascript
复制
=> Started proxy.                             
server/publications.ts (24, 10): Property 'publishComposite' does not exist on type 'typeof Meteor'.
server/main.ts (14, 28): Property '_options' does not exist on type 'typeof Accounts'.
server/main.ts (51, 14): Property 'createUserWithPhone' does not exist on type 'typeof Accounts'.
=> Started MongoDB.                           
=> Started your app.                          

=> App running at: http://localhost:3000/

然后我用ionic serve启动离子型应用程序,并在终端中得到这个。

代码语言:javascript
复制
Running live reload server: http://localhost:35729
Watching: www/**/*, !www/lib/**/*, !www/**/*.map
√ Running dev server:  http://localhost:8100

当我打开应用程序时,我在浏览器的控制台中得到了这个错误:

代码语言:javascript
复制
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8100/sockjs/info?cb=_07sz35uj7

据我所知,这意味着它试图从流星上获取数据,但无法到达。当我在浏览器中手动打开URL并将端口更改为3000时,我会从meteor获得一条消息。

我在Google上找到了两个提示:

1)启动不含肝负荷ionic serve --nolivereload的离子应用程序

2)将__meteor_runtime_config__设置为正确的URL:PORT

但是提示1不起作用,对于提示2,我不知道放在哪里。

在编写这篇文章时,我发现,在文件node_modules/meteor-client-side/meteor-runtime-config.js中,正确的端口由

代码语言:javascript
复制
__meteor_runtime_config__ = {};
__meteor_runtime_config__.DDP_DEFAULT_CONNECTION_URL = 'http://localhost:3000';

所以看起来提示2也已经完成了。为什么它仍然试图通过错误的端口到达流星服务器,或者可能还有另一个问题?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-11-22 14:14:43

好吧,我自己又解决了。我不得不将这些代码添加到我的index.html项目的ionic2文件中:

代码语言:javascript
复制
<script>
    __meteor_runtime_config__ = {
      DDP_DEFAULT_CONNECTION_URL: 'http://localhost:3000'
    };
</script>

不知道,为什么忽略node_modules/meteor-client-side/meteor-runtime-config.js文件中的配置。

编辑:看起来好像有一个错误在1.3.5版本的https://github.com/idanwe/meteor-client-side/issues/28#issuecomment-263252756中被修复了

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

https://stackoverflow.com/questions/40742303

复制
相关文章

相似问题

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