# VTK.js TypeError: Cannot read properties of undefined (reading 'SURFACE')

**URL:** https://discourse.vtk.org/t/vtk-js-typeerror-cannot-read-properties-of-undefined-reading-surface/14160
**Category:** Web
**Tags:** code, vtkjs
**Created:** [July 3, 2024, 2:56am UTC](https://discourse.vtk.org/t/vtk-js-typeerror-cannot-read-properties-of-undefined-reading-surface/14160 "2024-07-03T02:56:42Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![blc0000421](https://discourse.vtk.org/user_avatar/discourse.vtk.org/blc0000421/32/9040_2.png) [@blc0000421](https://discourse.vtk.org/u/blc0000421)
#### Post date: [July 3, 2024, 2:56am UTC](https://discourse.vtk.org/t/vtk-js-typeerror-cannot-read-properties-of-undefined-reading-surface/14160/1 "2024-07-03T02:56:42Z")

</div>

How can i solve this problem occured after [npm run build] with react.js  
but in development environment, it can work successfully.

 ![截圖 2024-07-03 上午10.56.30](https://discourse.vtk.org/uploads/default/original/2X/a/aef7ef8fca3bff147893c616616a01a101409f96.png)  
thank you!

---

<div class="post-metadata">

### Author: ![Forrest](https://discourse.vtk.org/user_avatar/discourse.vtk.org/forrest/32/300_2.png) [@Forrest](https://discourse.vtk.org/u/Forrest)
#### Post date: [July 3, 2024, 3:31pm UTC](https://discourse.vtk.org/t/vtk-js-typeerror-cannot-read-properties-of-undefined-reading-surface/14160/2 "2024-07-03T15:31:36Z")

</div>

What version of vtk.js are you using? How are you building your application?

---

<div class="post-metadata">

### Author: ![blc0000421](https://discourse.vtk.org/user_avatar/discourse.vtk.org/blc0000421/32/9040_2.png) [@blc0000421](https://discourse.vtk.org/u/blc0000421)
#### Post date: [July 15, 2024, 7:56am UTC](https://discourse.vtk.org/t/vtk-js-typeerror-cannot-read-properties-of-undefined-reading-surface/14160/4 "2024-07-15T07:56:35Z")

</div>

v30.10.1。 In both Vuejs & ReactJS development mode, it can run successfully. But it would failed after `build`.

why?

---

<div class="post-metadata">

### Author: ![Forrest](https://discourse.vtk.org/user_avatar/discourse.vtk.org/forrest/32/300_2.png) [@Forrest](https://discourse.vtk.org/u/Forrest)
#### Post date: [July 19, 2024, 3:13pm UTC](https://discourse.vtk.org/t/vtk-js-typeerror-cannot-read-properties-of-undefined-reading-surface/14160/5 "2024-07-19T15:13:12Z")

</div>

Can you provide a snippet of the code in your codebase that results in this error?

---

<div class="post-metadata">

### Author: ![Vivek\_Dev\_Shah](https://discourse.vtk.org/user_avatar/discourse.vtk.org/vivek_dev_shah/32/9161_2.png) [@Vivek\_Dev\_Shah](https://discourse.vtk.org/u/Vivek_Dev_Shah)
#### Post date: [August 7, 2024, 9:49pm UTC](https://discourse.vtk.org/t/vtk-js-typeerror-cannot-read-properties-of-undefined-reading-surface/14160/6 "2024-08-07T21:49:03Z")

</div>

Hey, just reduce the version of vtk.js to 28.0.0, will work.
