0

I'm trying to load a "local" file in a stackblitz project and I'm getting the following error

Error: ENOENT: No such file or directory., '/~/small.flb'

from this code

fs.readFile(__dirname + "/small.flb", function(err, data) {
  if (err) {
    throw err;
  }
  console.log(data.toString());
});

It seems like it has something to do with the virtualization, if you check the console in this Stackblitz you'll see the small.flb is not listed (note ./small.flb doesn't work either w/o __dirname)

joshp
  • 706
  • 5
  • 22

1 Answers1

0

I could be wrong, but people say that the ability has been stubbed out by FB, citing security...

I will note the behavior on StackBlitz was much different than a create-react-app local implementation, which seem to choke at webpack

I was only trying to set up a testing bed for react/node binary file reads, so I just ended up running a local copy of ERB

joshp
  • 706
  • 5
  • 22