# Error when recreating SVGRenderer Lines Example

**URL:** <https://discourse.threejs.org/t/error-when-recreating-svgrenderer-lines-example/9094>\
**Category:** Questions\
**Tags:** import, webgl-renderer\
**Created:** [August 16, 2019, 9:22pm UTC](https://discourse.threejs.org/t/error-when-recreating-svgrenderer-lines-example/9094 "2019-08-16T21:22:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![archimy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/archimy/32/6742_2.png) [@archimy](https://discourse.threejs.org/u/archimy)\
**Post date:** [August 16, 2019, 9:22pm UTC](https://discourse.threejs.org/t/error-when-recreating-svgrenderer-lines-example/9094/1 "2019-08-16T21:22:38Z")

</div>

I’m attempting to recreate the svg lines example ([three.js/examples/svg\_lines.html at c19a4c9fb09aa021c14e04190eb4c9106ec6eac6 · mrdoob/three.js · GitHub](https://github.com/mrdoob/three.js/blob/c19a4c9fb09aa021c14e04190eb4c9106ec6eac6/examples/svg_lines.html)) and each time I do i get:

> Uncaught SyntaxError: The requested module ‘/SVGTest/js/SVGRenderer.js’ does not provide an export named ‘SVGRenderer’

in response to svg\_lines.html:27

the export is clearly defined on SVGRenderer.js:554

Any ideas why I can’t import that function?

thanks!

---

<div class="post-metadata">

**Author:** ![archimy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/archimy/32/6742_2.png) [@archimy](https://discourse.threejs.org/u/archimy)\
**Post date:** [August 16, 2019, 10:30pm UTC](https://discourse.threejs.org/t/error-when-recreating-svgrenderer-lines-example/9094/3 "2019-08-16T22:30:29Z")

</div>

I’ve reworked the example without using modules to see if it was a file path error, starting from scratch with a new folder, clearing my cache etc. as such:

```
<body>
		<script src="js/three.js"></script>
		<script src="js/SVGRenderer.js"></script>
		<script>
			var camera, scene, renderer;
			init();
			animate();
			function init() {
				camera = new THREE.PerspectiveCamera( 33, window.innerWidth / window.innerHeight, 0.1, 100 );
				camera.position.z = 10;
				scene = new THREE.Scene();
				scene.background = new THREE.Color( 0, 0, 0 );
				renderer = new SVGRenderer();
				renderer.setSize( window.innerWidth, window.innerHeight );
				document.body.appendChild( renderer.domElement );

```

Now I get the error:

> Uncaught ReferenceError: SVGRenderer is not defined  
> at init (index.html:29) ie. renderer = new SVGRenderer();

stumped…

Would love if someone could show me a quick way to avoid this

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [August 17, 2019, 8:39am UTC](https://discourse.threejs.org/t/error-when-recreating-svgrenderer-lines-example/9094/4 "2019-08-17T08:39:14Z")

</div>

> [@archimy](#):
>
> I’ve reworked the example without using modules

I this case, you have to create the renderer like so: `renderer = new THREE.SVGRenderer();`.

When importing classes from the `js` directory, they are always defined in the `THREE` namespace. This is not true for the respective module versions.
