First argument to DataView constructor must be an ArrayBuffer when using inspect()
See original GitHub issueI’m trying to implement gltf-transform
into my Vue project in order to make use of the inspect()
method for my gltf/glb files.
This is what I’m trying to do
import { WebIO } from '@gltf-transform/core'
import { inspect } from '@gltf-transform/lib'
// data.gltf === a URL at which the resource can be achieved (I can link it if necessary)
const gltfFile = data.gltf
const io = new WebIO()
const doc = await io.read(gltfFile)
inspect(doc)
But I seem to be getting this error
caught TypeError: First argument to DataView constructor must be an ArrayBuffer
at new DataView (<anonymous>)
at Function.m (core.modern.js:1)
at Function.getSize (core.modern.js:1)
at lib.modern.js:1
at Array.map (<anonymous>)
at q (lib.modern.js:1)
at k (lib.modern.js:1)
at _callee$ (_modelId.vue:180)
at tryCatch (runtime.js:63)
at Generator.invoke [as _invoke] (runtime.js:293)
at Generator.next (runtime.js:118)
at asyncGeneratorStep (asyncToGenerator.js:3)
at _next (asyncToGenerator.js:25)
Any ideas as to what I’m doing wrong?
(Apologies if this isn’t the right place to post this, let me know if it would be better suited for somewhere else)
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
First argument to DataView constructor must be an ArrayBuffer
Yes. The database will open properly and work just fine but through some event, either me closing the browser window or something else....
Read more >DataView() constructor - JavaScript - MDN Web Docs
DataView() constructor. The DataView() constructor is used to create DataView objects. ... If unspecified, the buffer view starts with the first byte.
Read more >Using EXIF and BinaryFile get an error - Stack Overflow
But I get: TypeError: First argument to DataView constructor must be an ArrayBuffer ? How can I get this array buffer? I'm using...
Read more >First argument to DataView constructor must be an ArrayBuffer
When attempting to open database in Chrome I receive the following error: "First argument to DataView constructor must be an ArrayBuffer".
Read more >Memory Inspector: Inspect ArrayBuffer, TypedArray, DataView ...
Use the new Memory inspector to inspect ArrayBuffer , TypedArray , and DataView memory in JavaScript as well as WebAssembly.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ahhh, that’s helpful. I will investigate that further, thank you!
I’m not sure why the tool is reading this file without clearer warnings, but it seems to have two entries for images that are not valid:
^Those should have either a
bufferView
or auri
property to be valid, without them there is no image data. It may be a bug in COLLADA2GLTF, which seems to be the converter that produced this model.I’ll make some adjustments to ensure that glTF-Transform provides a more useful warning about this issue. In the meantime https://github.khronos.org/glTF-Validator/ may be helpful for double-checking your model’s validity.