{"action":"created","issue":{"url":"https://api.github.com/repos/meteor/meteor/issues/10066","repository_url":"https://api.github.com/repos/meteor/meteor","labels_url":"https://api.github.com/repos/meteor/meteor/issues/10066/labels{/name}","comments_url":"https://api.github.com/repos/meteor/meteor/issues/10066/comments","events_url":"https://api.github.com/repos/meteor/meteor/issues/10066/events","html_url":"https://github.com/meteor/meteor/issues/10066","id":340420589,"node_id":"MDU6SXNzdWUzNDA0MjA1ODk=","number":10066,"title":"RangeError: Maximum call stack size exceeded Unhandled Promise Rejection Warning","user":{"login":"neutron92","id":6135555,"node_id":"MDQ6VXNlcjYxMzU1NTU=","avatar_url":"https://avatars3.githubusercontent.com/u/6135555?v=4","gravatar_id":"","url":"https://api.github.com/users/neutron92","html_url":"https://github.com/neutron92","followers_url":"https://api.github.com/users/neutron92/followers","following_url":"https://api.github.com/users/neutron92/following{/other_user}","gists_url":"https://api.github.com/users/neutron92/gists{/gist_id}","starred_url":"https://api.github.com/users/neutron92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neutron92/subscriptions","organizations_url":"https://api.github.com/users/neutron92/orgs","repos_url":"https://api.github.com/users/neutron92/repos","events_url":"https://api.github.com/users/neutron92/events{/privacy}","received_events_url":"https://api.github.com/users/neutron92/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-11T21:58:28Z","updated_at":"2018-07-12T08:40:45Z","closed_at":"2018-07-12T08:40:45Z","author_association":"NONE","body":"\r\nHello,\r\n\r\n```\r\n(node:11557) UnhandledPromiseRejectionWarning: RangeError: Maximum call stack size exceeded\r\nat Array.forEach (<anonymous>)\r\n at Object.EJSON.clone (packages/ejson/ejson.js:594:18)\r\nat packages/ejson/ejson.js:595:22\r\nat Array.forEach (<anonymous>)\r\nat Object.EJSON.clone (packages/ejson/ejson.js:594:18)\r\nat packages/ejson/ejson.js:595:22\r\nat Array.forEach (<anonymous>)\r\n at Object.EJSON.clone (packages/ejson/ejson.js:594:18)\r\n at packages/ejson/ejson.js:595:22\r\n at Array.forEach (<anonymous>)\r\n(node:11557) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 8)\r\n```\r\n\r\ni have this error when i'm debugging i see that it was from this code lines \r\nPS: if i comment the find i don't see the error\r\n \r\n\r\n```\r\n try {\r\n            console.log(\"useruseruser1\", user);\r\n\r\n            var searchOptions = {};\r\n\r\n            if (!user.role || user.role == \"\" || user.role == \"all\") {\r\n                searchOptions[\"roles.app\"] = {\r\n                    $ne: \"super-admin\"\r\n                }\r\n            } else {\r\n            searchOptions[\"roles.app\"] = user.role\r\n            }\r\n\r\n            if (user.keyword && user.keyword != \"\") {\r\n                searchOptions.$or = [{\r\n                        \"profile.firstName\": {\r\n                            $regex: user.keyword,\r\n                            $options: 'i'\r\n                        }\r\n                    },\r\n                    {\r\n                        \"username\": {\r\n                            $regex: user.keyword,\r\n                            $options: 'i'\r\n                        }\r\n                    },\r\n                    {\r\n                        \"profile.lastName\": {\r\n                            $regex: user.keyword,\r\n                            $options: 'i'\r\n                        }\r\n                    },\r\n                    {\r\n                        \"profile.bio\": {\r\n                            $regex: user.keyword,\r\n                            $options: 'i'\r\n                        }\r\n                    },\r\n                    {\r\n                        \"emails.address\": {\r\n                            $regex: user.keyword,\r\n                            $options: 'i'\r\n                        }\r\n                    },\r\n                    {\r\n                        \"profile.id\": {\r\n                            $regex: user.keyword,\r\n                            $options: 'i'\r\n                        }\r\n                    }\r\n                ];\r\n            }\r\n            searchOptions[\"profile.removed\"] = false\r\n            console.log('searchOptionssearchOptions', searchOptions);\r\n        \r\n            return Meteor.users.find(searchOptions, {\r\n                fields: {\r\n                    'username': 1,\r\n                    'emails': 1,\r\n                    'profile': 1,\r\n                    'roles': 1\r\n                }, // Ending Row\r\n                sort: {\r\n                    \"profile.createdAt\": -1 //Sort by Date Added DESC\r\n                }\r\n            })\r\n        } catch (error) {\r\n            console.log(\"GetAllUsers Error\", error);\r\n            if (error.reason) {\r\n                throw new Meteor.Error(203, error.reason);\r\n            } else {\r\n                throw new Meteor.Error(203, error);\r\n            }\r\n        }\r\n```"},"comment":{"url":"https://api.github.com/repos/meteor/meteor/issues/comments/404436278","html_url":"https://github.com/meteor/meteor/issues/10066#issuecomment-404436278","issue_url":"https://api.github.com/repos/meteor/meteor/issues/10066","id":404436278,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDQzNjI3OA==","user":{"login":"neutron92","id":6135555,"node_id":"MDQ6VXNlcjYxMzU1NTU=","avatar_url":"https://avatars3.githubusercontent.com/u/6135555?v=4","gravatar_id":"","url":"https://api.github.com/users/neutron92","html_url":"https://github.com/neutron92","followers_url":"https://api.github.com/users/neutron92/followers","following_url":"https://api.github.com/users/neutron92/following{/other_user}","gists_url":"https://api.github.com/users/neutron92/gists{/gist_id}","starred_url":"https://api.github.com/users/neutron92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neutron92/subscriptions","organizations_url":"https://api.github.com/users/neutron92/orgs","repos_url":"https://api.github.com/users/neutron92/repos","events_url":"https://api.github.com/users/neutron92/events{/privacy}","received_events_url":"https://api.github.com/users/neutron92/received_events","type":"User","site_admin":false},"created_at":"2018-07-12T08:40:45Z","updated_at":"2018-07-12T08:40:45Z","author_association":"NONE","body":"https://forums.meteor.com/t/resolved-rangeerror-maximum-call-stack-size-exceeded-unhandled-promise-rejection-warning/44448/9"}}
{"actor":{"display_login":"neutron92"}}