Closed h4 closed 3 years ago
Likely it fixes your problem but this solution makes every declaration execution asynchronous what may lead to unsuitable delay for long dependency path. We have more than thousand declarations in one file and never encountered such a problem. Maybe better to report problem to FF team? Especially as it happens only in FF@linux.
I'll try to find FF@linux and run pure test with a huge number of modules.
@dfilatov ping
@korotovsky Could you try out the following code?
var MODULES_COUNT = 1000;
for(var i = 0; i < MODULES_COUNT; i++) {
modules.define('module' + i, i > 0? ['module' + (i - 1)] : [], function(provide) {
provide(this.name);
});
}
modules.require('module' + (MODULES_COUNT - 1), function(module) {
console.log(module + ' resolved');
});
This summer we got error 'too much recursion' in our project that uses bem-core.
This error happens only in Firefox under linux (yeah, Ubuntu) and only if we have lot modules in one file (~200 in our case).
Delay applying declarations with wrap in
nextTick
fix this problem (this solution was found in https://github.com/pouchdb/pouchdb/issues/1156#issuecomment-31136504).