score:16

Accepted answer

You are missing the character set in your HTML page. Add something like this:

<meta charset="utf-8">

The un-minified source of D3 includes the actual symbol for pi, which confuses the browser if the character set is not defined.

score:0

Was having similar issue. My problem was my script file was loading before it could load the d3js library. Just adding defer fixed the issue.

<script src="app.js" defer></script>

score:7

I am going to assume that you are testing this out without a web server. If so, then your URL will read file://.... not http://..

With this, the Javascript request will go to file:///.../D3/d3/d3.v3.js which won't have the proper response header set, such as charset and MIME.

You can always get it from a CDN to avoid this problem:

<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>

More Query from same tag