Hey!
I’m using Vue (via Nuxt) and AFrame in a project together, so far everything is working out well.
(even got some render functions for components going on - everything is super smooth. Very impressed with Zappar)
Up until this point I’ve been using the Zappar library and AFrame via script tags, but it’s a requirement by our client to bundle the application entirely.
I’ve tried to install Zappar into my project from npm and I’ve updated the webpack config to load zcv.wasm with file-loader.
Unfortunately I’m running into “TypeError: Cannot read property ‘startsWith’ of undefined” in zcv.js.
This seems to happen in a fresh Nuxt.js project and even a fresh Vue (2) project, both created via their respective CLIs.
I’m a bit baffled considering I’m able to clone and run the webpack examples on the Zappar GitHub just fine.
Have you seen this error before?
It seems to be the reference to the wasm file from what I can make out in the minified code, but it’s difficult to trace as even when formatted, Chrome’s breakpoints seem to fail in zcv.js.
I’ve uploaded an example Vue.js project to this post.
It has no AFrame scene, but the error is independent of AFrame initialising.
With the Vue CLI installed you can output the webpack config to inspect:
https://cli.vuejs.org/guide/webpack.html#inspecting-the-project-s-webpack-config
zappar-vue.zip (263.9 KB)
Thanks,
Sam