Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MODULE NAME 'fs' HAS NOT BEEN LOADED YET FOR CONTEXT by using viz.js #36

Closed
tommywsq opened this issue Dec 2, 2014 · 1 comment
Closed
Labels

Comments

@tommywsq
Copy link

tommywsq commented Dec 2, 2014

Hi,

I got a problem when used viz.js to create graph. You can see the code as follow:

var deps = [
"viz.js"
];

require( deps, function() {
drawGraph();
});

function drawGraph(){
var g = "digraph G { a1 -> b3; b2 -> a3; a3 -> a0; }";
var tt=Viz(g,"svg");
document.body.innerHTML += tt;
}

I got the error: Uncaught Error: Module name "fs" has not been loaded yet for context: _. Use require([])
http://requirejs.org/docs/errors.html#notloaded

Then I checked the viz.js file, and I found the problem in the file:

var Ub=require("fs"),var Vb=require("path");

You can find this line in the viz.js file. I have checked on the Internet. It should be like :

require(["fs","path"], function() {
var Ub=require("fs"),var Vb=require("path");
});

Is this a mistake? If not, how to solve this problem?

Thanks in advanced.

@akinnee-gl
Copy link

fs doesn't exist in the browser, but you can make a fake version of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants