2017-02-21 1 views
0

저는 Meteor에 새로 입문했습니다. 나는 간단한 앱을하고있다.Meteor : Uncaught RangeError : 최대 호출 스택 크기가 초과되었습니다.

Template.newFeedForm.events({ 
 
    'submit #new-feed-form'(event) { 
 
     event.preventDefault(); 
 

 
     const target = event.target; 
 
     const text = target.text; 
 

 
     Meteor.call('feeds.insert', text); 
 

 
     target.text.value = ''; 
 
    } 
 
});

그래서 내가 newFeedForm 템플릿을 내 feeds.js에 내가 주석

Meteor.methods({ 
 
    'feeds.insert'(text){ 
 
     check(text, String); 
 
     //check(hashtag, String); 
 

 
     // Make sure the user is logged in before inserting a task 
 
     if (! this.userId) { 
 
      throw new Meteor.Error('not-authorized'); 
 
     } 
 
     console.log(this.userId); 
 

 
     // Feeds.insert({ 
 
     //  text: text, 
 
     //  owner: this.userId, 
 
     //  username: Meteor.users.findOne(this.userId).username, 
 
     //  createdAt: new Date() 
 
     // }); 
 
    } 
 
});

이 : 여기 는 내가 가지고있는 문제 Feeds.insert는 여기에 문제가 있다고 생각합니다. 뭔가 다른 것 같습니다.

Uncaught RangeError: Maximum call stack size exceeded 
 
    at Function._.(anonymous function) [as isArguments] (http://localhost:3000/packages/underscore.js?hash=cde485f60699ff9aced3305f70189e39c665183c:1068:30) 
 
    at Object.EJSON.clone (http://localhost:3000/packages/ejson.js?hash=0f17ced99d522d48cd8f8b2139167fd06babd969:512:25) 
 
    at http://localhost:3000/packages/ejson.js?hash=0f17ced99d522d48cd8f8b2139167fd06babd969:531:22 
 
    at Function._.each._.forEach (http://localhost:3000/packages/underscore.js?hash=cde485f60699ff9aced3305f70189e39c665183c:157:22) 
 
    at Object.EJSON.clone (http://localhost:3000/packages/ejson.js?hash=0f17ced99d522d48cd8f8b2139167fd06babd969:530:5) 
 
    at http://localhost:3000/packages/ejson.js?hash=0f17ced99d522d48cd8f8b2139167fd06babd969:531:22 
 
    at Function._.each._.forEach (http://localhost:3000/packages/underscore.js?hash=cde485f60699ff9aced3305f70189e39c665183c:157:22) 
 
    at Object.EJSON.clone (http://localhost:3000/packages/ejson.js?hash=0f17ced99d522d48cd8f8b2139167fd06babd969:530:5) 
 
    at http://localhost:3000/packages/ejson.js?hash=0f17ced99d522d48cd8f8b2139167fd06babd969:531:22 
 
    at Function._.each._.forEach (http://localhost:3000/packages/underscore.js?hash=cde485f60699ff9aced3305f70189e39c665183c:157:22)
는 무슨 일이 일어나고 있는지 아무 생각이 : 는 Meteor.call가 실행될 때마다 나는이 있어요. 다음은이 오류를 재현 나의 REPO입니다 : (유성 방법을 다룰 때 특히)이 같은 오류가 발생할 때 당신이 아마 "올바른"데이터 (또는 데이터를 전달하지 않는 의미, 일반적으로 https://github.com/yerassyl/nurate-meteor

+0

잘못 가져 왔습니까? 주어진대로, 당신의 코드는 그 오류를 던져서는 안된다. 디버거를 통해 실행 해 보셨습니까? – chazsolo

+0

제출 처리기를 한 번만 입력했음을 확인 했습니까? – zim

답변

1

을 당신을 너라고 생각했다).

양식 처리 코드를 살펴보면 텍스트 영역 데이터를 결코 얻지 못하는 것으로 나타났습니다.

const text = target.text; 

target.text는 실제 텍스트 영역 DOM 객체를 반환하지만 실제로는 그 객체가 포함하는 값입니다. 아래 코드는 문제를 해결합니다.

const text = target.text.value; 
관련 문제