brfs icon indicating copy to clipboard operation
brfs copied to clipboard

Usage from grunt-browserify not working

Open sonicoder86 opened this issue 11 years ago • 5 comments

I tried to use it from grunt but when i require 'fs' start getting the following error:

TypeError: Cannot read property 'range' of null

Any idea where doe it come from?

sonicoder86 avatar Jul 15 '14 18:07 sonicoder86

Got it working. The problem is it needs the var statement at the start of line:

var fs = require('fs');

But this doesnt work:

var foo ='bar',
    fs = require('fs');

sonicoder86 avatar Jul 15 '14 18:07 sonicoder86

@substack - I too am experiencing this error, however the fix proposed by @blacksonic only resulted in a new error being raised:

Error: unsupported type for static module: Property
at expression:

  value: fs

Rob-pw avatar Jan 15 '15 15:01 Rob-pw

Depressingly enough downgrading all the way to [email protected] resolved the issue.

As a separate problem, it would appear that brfs doesn't work when fs is passed as a reference into functions.

Rob-pw avatar Jan 15 '15 15:01 Rob-pw

Thanks for this great tool!

I had the same issue as blacksonic:

Works

var fs = require('fs');
var insertCss = require('insert-css');

Doesn't work

var fs = require('fs'),
    insertCss = require('insert-css');

paulmelnikow avatar Jan 18 '15 00:01 paulmelnikow

I've also run into this issue, using the straight brfs module (inside of Gulp).

girvo avatar Mar 16 '15 02:03 girvo