Closed webuniverseio closed 11 years ago
got similar error on mac. Installed TernJS using package manager.
Staring TernJS server for /Users/jodaka/git/widgets/gallery.sublime-project with 1 libs and 2091 files
Traceback (most recent call last):
File "./tern.py", line 82, in init
sync_all_projects()
File "./tern.py", line 368, in sync_all_projects
sync_project(p)
File "./tern.py", line 348, in sync_project
ctx.js().locals.startServer(json.dumps(p, ensure_ascii=False), resolved_libs)
IndexError: RangeError: Maximum call stack size exceeded ( js/infer.js @ 302 : 38 ) -> var match = /^(.*)\.prototype$/.exec(this.proto.name);
After some digging I've discovered that TernJS ignores following configuration from my project file:
"ternjs": {
"exclude": [ "node_modules/**" ],
"libs": [ "browser" ]
}
I've tried removing node_modules catalog and TernJS error disappears and it started working. But when I restored node_modules initial error occurs again.
Sorry, closed by wrong commit identifier :)
Anyway, your should post such errors to main TernJS repo
Are you sure it's a TernJS bug, not a sublime-tern? As it seems the problem can be fixed by correct handling of "exclude" property in sublime project config.
Yes, it’s TernJS bug:
RangeError: Maximum call stack size exceeded ( js/infer.js @ 302 : 38 )
The problem is that TernJS can’t properly parse and infer data in some circumstances. The exclude
property simply excludes these files from Tern server so they are not parsed at all.
Сергей, можно я по-русски отвечу, а то, кажется, моего английского недостаточно, чтобы описать проблему.
Ошибка с парсингом внутри TernJS, это, конечно, плохо. Но я имел в виду, что опция exclude НЕ работает. Т.е. я указываю в ней
"exclude": [ "node_modules/**" ],
и ожидаю, что ни один js файл из node_modules в TernJS отправлен не будет. Однако, эта опция у меня НЕ работает и все JS из node_modules отправляются в TernJS.
Странно... Я так понимаю, вы на OSX? Можете полностью показать содержимое .sublime-project
?
да, я на OSX сижу. Вот конфиг проекта https://gist.github.com/jodaka/5312826#file-quiz-sublime-project Если я его редактирую и жму Save, то в консоли саблайма видно следующее:
Writing file /Users/jodaka/git/widgets/quiz.sublime-project with encoding UTF-8
Syncing project /Users/jodaka/git/widgets/gallery.sublime-project
Staring TernJS server for /Users/jodaka/git/widgets/gallery.sublime-project with 1 libs and 1014 files
В самом проекте не больше десятка .js файлов, а ещё тысяча штук подсасывается из node_modules
А можете показать несколько полных путей к JS-файлам из node_modules
? Чтобы я проверил, как матчатся пути.
вот, например, путь к js из пакета grunt-contrib-watch:
/Users/jodaka/git/widgets/quiz/node_modules/grunt-contrib-watch/watch.js
или вот handlebars и его зависимости
/Users/jodaka/git/widgets/quiz/node_modules/handlebars/lib/handlebars.js
/Users/jodaka/git/widgets/quiz/node_modules/handlebars/node_modules/uglify-js/uglify-js.js
/Users/jodaka/git/widgets/quiz/node_modules/handlebars/node_modules/optimist/node_modules/wordwrap/index.js
Хм, странно: я воссоздал проект по этим данным, и у меня загрузились только нужные файлы. Буду думать ещё.
На винде вроде exclude работает (т.е. дополнений из исключенных файлов нет), но количество найденных файлов тоже не меняется. Может просто число неправильное показывается?
Не, там правильно всё показывается. Я потом сделаю вывод отладочной информации, чтобы можно было посмотреть, какие именно файлы загружаются.
On sublime start-up I get following error from ternjs (version: 3022 windows x64 channel: dev)
TernJS: No need to update PyV8 Syncing project D:\78Digital_projects\alliance\contests\eone-tarantino\eone-tarantino.sublime-project Staring TernJS server for D:\78Digital_projects\alliance\contests\eone-tarantino\eone-tarantino.sublime-project with 1 libs and 45 files Traceback (most recent call last): File "D:\Program Files\Sublime Text 3\sublime_plugin.py", line 156, in on_api_ready m.plugin_loaded() File "D:\Program Files\Sublime Text 3\Data\Installed Packages\sublime-tern.sublime-package\tern.py", line 528, in plugin_loaded init() File "D:\Program Files\Sublime Text 3\Data\Installed Packages\sublime-tern.sublime-package\tern.py", line 82, in init sync_all_projects() File "D:\Program Files\Sublime Text 3\Data\Installed Packages\sublime-tern.sublime-package\tern.py", line 368, in sync_all_projects sync_project(p) File "D:\Program Files\Sublime Text 3\Data\Installed Packages\sublime-tern.sublime-package\tern.py", line 348, in sync_project ctx.js().locals.startServer(json.dumps(p, ensure_ascii=False), resolved_libs) IndexError: RangeError: Maximum call stack size exceeded ( js/infer.js @ 0 : -1 ) -> // Main type inference engine