Comments (14)
Thanks for your report. Please, provide a minimal setup needed to reproduce an error (you can send me a zipball with assets and minimal mincer initilization that reproduces this error) so I could fix the problem quickly.
from mincer.
I believe that the problem could be resolved with one of the latest commits (there were some bugs in directive processor), if so, please close the ticket. If not, please, provide a minimal setup so I could reproduce an error (you may send it on my e-mail if it contains sensitive information)
from mincer.
Just updated to latest commit. Now I get Segmentation fault: 11
.
Before it was just Served asset /application.js?body=1 - 500 Error compiling asset: Maximum call stack size exceeded (in /Users/v/dev/x/node/app/assets/javascripts/info.coffee) (585ms)
info.coffee
is the last file I require.
I'll try create a project to reproduce the error.
from mincer.
Adding this line Mincer.unregisterPostProcessor 'application/javascript', Mincer.SafetyColons
gets rid of the seg fault but still causes the max call stack error. However I don't think its related to SafetyColons, anything that decreases stack size could fix.
I'm using node 8.6. I'll try 8.8 now.
from mincer.
To fix we need to clear the stack using process.nextTick
. I changed mincer/context.js#329
to process.nextTick(function(){callback(err, result);});
and it resolved it. Not sure if this is the best place for it performance-wise though.
from mincer.
Such dirty magic can not be accepted to upstream. Using nextTick() is very bad practice in most cases. Please, try to make minimalistic example, that will help to reproduce your problem.
from mincer.
I wouldn't say its that dirty. The problem is with async.forEachSeries
.
There's a few people with similar issues from using async
:
http://mwebhack.blogspot.com.au/2012/06/careful-with-synchronous-operations-in.html
To reproduce I expect a project with a lot (100+) files will cause it.
On Tue, Sep 11, 2012 at 3:50 PM, Vitaly Puzrin [email protected]:
Such dirty magic can not be accepted to upstream. Using nextTick() is very
bad practice in most cases. Please, try to make minimalistic example, that
will help to reproduce your problem.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/31#issuecomment-8447810.
from mincer.
Okay to reproduce:
In examples
:
npm install coffee-script
cd assets/javascripts`
for i in {1..200}; do touch test$i.coffee; done
Note: Try increase the number of files if you don't get the error.
Then add //= require_tree .
to assets/javascripts/app.js
node server.js
RangeError: Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
from mincer.
In your example //= require_tree .
is recursive. It's evident. May be, mincer should better detect such situation, but basically, it's your bug.
from mincer.
Create a new directory with the test files called test
.
Change directive to //= require_tree test
Error still there. require_directory
is the same.
On Tue, Sep 11, 2012 at 4:14 PM, Vitaly Puzrin [email protected]:
In your example require_tree is recursive. It's evident. May be, mincer
should better detect such situation, but basically, it's your bug.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/31#issuecomment-8448142.
from mincer.
Yeah, i just did the same :) . 200 files are problem, 10 files are ok.
Now, back to real life. Is bug in your project caused by large number of included coffescripts, or by recursive require_tree (or smthng else)? We just need to clarify, where to dig first.
from mincer.
Large number of coffeescripts. The example was just for demonstration
purposes. My experience with this bug as detailed above points to the
problem being related to the number of files.
On Tue, Sep 11, 2012 at 4:29 PM, Vitaly Puzrin [email protected]:
Yeah, i just did the same :) . 200 files are problem, 10 files are ok.
Now, back to real life. Is bug in your project caused by large number of
coffescripts, or by reqursive require_tree ?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/31#issuecomment-8448377.
from mincer.
285 text files.
283 unique files.
328 files ignored.
http://cloc.sourceforge.net v 1.56 T=2.0 s (103.5 files/s, 41156.0 lines/s)
Language files blank comment
code
Javascript 76 9375 11218
40905
CSS 9 1519 102
9926
CoffeeScript 113 1505 1314
6321
SQL 8 5 7
111
YAML 1 0 0
4
SUM: 207 12404 12641
57267
On Tue, Sep 11, 2012 at 5:01 PM, Vaughan Rouesnel [email protected]:
Large number of coffeescripts. The example was just for demonstration
purposes. My experience with this bug as detailed above points to the
problem being related to the number of files.On Tue, Sep 11, 2012 at 4:29 PM, Vitaly Puzrin [email protected]:
Yeah, i just did the same :) . 200 files are problem, 10 files are ok.
Now, back to real life. Is bug in your project caused by large number of
coffescripts, or by reqursive require_tree ?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/31#issuecomment-8448377.
from mincer.
I'll try to fix it asap
from mincer.
Related Issues (20)
- manifest.compile is not returning to console HOT 2
- Problem with tpl.js files HOT 3
- Update autoprefixer dependencies HOT 1
- Jade deprecation warning is so damn ugly in my log HOT 1
- Sourcemaps combined with Autoprefixer fails HOT 7
- Manifest#compile does not support regExp files patterns.
- Supporting polymer webcomponents HOT 1
- How to use the cli? HOT 11
- Expose the prop method in the mincer instance HOT 3
- Request - Support HTML files in directive processor HOT 2
- ejs support HOT 2
- require_glop directive HOT 1
- Change deprecated use of csso.justDoIt() to csso.minify() HOT 1
- please version bump!
- Generating bootstrap-sass source map via connect-assets is throwing an "Invalid mapping" error
- Promise based support for Template.prototype.evaluate HOT 8
- Support for CoffeeScript v2 HOT 4
- Update dependencies HOT 1
- Firefox's save feature does not work with the sass file
- Maintenance HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mincer.