# DataAccessHelper is not defined

**URL:** https://discourse.vtk.org/t/dataaccesshelper-is-not-defined/8139
**Category:** Web
**Created:** [March 24, 2022, 10:32pm UTC](https://discourse.vtk.org/t/dataaccesshelper-is-not-defined/8139 "2022-03-24T22:32:11Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Nicolas\_Schmidt](https://discourse.vtk.org/user_avatar/discourse.vtk.org/nicolas_schmidt/32/3681_2.png) [@Nicolas\_Schmidt](https://discourse.vtk.org/u/Nicolas_Schmidt)
#### Post date: [March 24, 2022, 10:32pm UTC](https://discourse.vtk.org/t/dataaccesshelper-is-not-defined/8139/1 "2022-03-24T22:32:11Z")

</div>

In @kitware/vtk.js version 23.3.0 I’m receiving an error that DataAccessHelper is not defined.

This would be the module imported from:  
`import DataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper'`

In VSCode I’m getting the following hint:

 ![Screen Shot 2022-03-24 at 6.05.11 PM](https://discourse.vtk.org/uploads/default/original/2X/3/31e51699516a951da7a485ecba3c28e8068eb1b5.png)

My code is following the SceneExplorer example here:

> **[vtk.js](https://kitware.github.io/vtk-js/examples/SceneExplorer.html)**
>
> SceneExplorerLive example ## Scene Explorer The Scene Explorer is a standalone single page web application that can be user to visualizer and explore 3D scene that have been exported with ParaView. T

Has something changed intentionally that needs us to shift how we use the DataAccessHelper?

If this is a regression I can spend a little time to track down why this may be happening tomorrow…

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [March 24, 2022, 11:23pm UTC](https://discourse.vtk.org/t/dataaccesshelper-is-not-defined/8139/2 "2022-03-24T23:23:25Z")

</div>

Not sure about the ESM part of it, but you need to explicitly load the concrete implementation of them so they can became available.

That was added to allow better tree shaking and reduce bundle size when pieces of vtk.js were not use.

Try adding the following import in your code.  
`import '@kitware/vtk.js/IO/Core/DataAccessHelper/ZipDataAccessHelper'; `

---

<div class="post-metadata">

### Author: ![Nicolas\_Schmidt](https://discourse.vtk.org/user_avatar/discourse.vtk.org/nicolas_schmidt/32/3681_2.png) [@Nicolas\_Schmidt](https://discourse.vtk.org/u/Nicolas_Schmidt)
#### Post date: [March 25, 2022, 1:39pm UTC](https://discourse.vtk.org/t/dataaccesshelper-is-not-defined/8139/3 "2022-03-25T13:39:01Z")

</div>

Hey @Sebastien_Jourdain I figured it out -

I imported the appropriate function using:  
`import { get } from '@kitware/vtk.js/IO/Core/DataAccessHelper.js'`

It looks like this would also work:  
`import { DataAccessHelper } from '@kitware/vtk.js/IO/Core/DataAccessHelper.js'`

The export from `.../IO/Core/DataAccessHelper.js` looks like this:

`export { DataAccessHelper as default, get, has, registerType };`

I am not familiar with that notation, it looks like writing it as the following solves the issue:

```auto
export default DataAccessHelper;
export { get, has, registerType };

```

I can open an issue with the above information.

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [March 25, 2022, 2:47pm UTC](https://discourse.vtk.org/t/dataaccesshelper-is-not-defined/8139/4 "2022-03-25T14:47:31Z")

</div>

I’m not sure to understand what you are talking about? Does your code works now? Is it just a TypeScript definition error, or the missing Zip handler?

---

<div class="post-metadata">

### Author: ![Nicolas\_Schmidt](https://discourse.vtk.org/user_avatar/discourse.vtk.org/nicolas_schmidt/32/3681_2.png) [@Nicolas\_Schmidt](https://discourse.vtk.org/u/Nicolas_Schmidt)
#### Post date: [March 25, 2022, 2:52pm UTC](https://discourse.vtk.org/t/dataaccesshelper-is-not-defined/8139/5 "2022-03-25T14:52:56Z")

</div>

Yes my code works now.

The error I’m talking about is just in the way the DataAccessHelper module is exported.

Importing DataAccess helper this way:  
`import DataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper'`

Was causing an error for me.

Importing it either of the following ways seem to work given the way it’s exported:  
`import { DataAccessHelper } from '@kitware/vtk.js/IO/Core/DataAccessHelper'`  
`import { get } from '@kitware/vtk.js/IO/Core/DataAccessHelper'`

---

<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: [March 29, 2022, 2:29pm UTC](https://discourse.vtk.org/t/dataaccesshelper-is-not-defined/8139/6 "2022-03-29T14:29:52Z")

</div>

A follow-up: the default export will be exposed once this PR is merged: [fix(DataAccessHelper): ts defs default export by floryst · Pull Request #2334 · Kitware/vtk-js · GitHub](https://github.com/Kitware/vtk-js/pull/2334)
