Threejs TextGeometry doesn't exist on threejs package

I’ve tried to initiate TextGeometry but I’m prompted with the error `_three.TextGeometry is not a function I’m using parcel as my package manger and here are my dependencies

  "dependencies": {
    "dat.gui": "^0.7.9",
    "parcel": "^2.7.0",
    "three": "^0.145.0"
  },

and here is a snippet of my code

this.textGeometry = new THREE.TextGeometry("Hello world!", {
      font: typefaceFont,
      size: 0.5,
      height: 0.2,
      curveSegments: 12,
      bevelEnabled: true,
      bevelThickness: 0.03,
      bevelSize: 0.02,
      bevelOffset: 0,
      bevelSegments: 5,
    });

could someone tell me what’s wrong with this?

Hi!
Did you import TextGeometry?
Like in this example: three.js examples
Line: three.js/webgl_geometry_text.html at d081c5a3501d272d19375fab1b01fedf9df29b22 · mrdoob/three.js · GitHub

2 Likes

you’re right thank you, what about TextBufferGeometry?

For many revisions, all geometries, including TextGeometry, in three.js are BufferGeometry.
изображение

2 Likes

Thank you, much appreciated