google / google/draco

wasm path is not correct in electron environment

Open
#740 3 comments 0 reactions 0 assignees View on GitHub
documentation Feature Request
Dominant language
C++
Stars
7.5k
Forks
1.1k
Avg merge
47m
Merged PRs (30d)
1

Description

When use draco in my electron app, It fetch http://draco_encoder.wasm/

It's ok when I use it in my react useMount hooks, I can get table.wasm with code
It fetch http://localhost:8238/table.wasm

```
useMount(()=>{
var otherTable = new WebAssembly.Table({ element: "anyfunc", initial: 2 });

WebAssembly.instantiateStreaming(fetch('table.wasm',{credentials:"same-origin"}))
.then(obj => {
var tbl = obj.instance.exports.tbl as any;
console.log(tbl.get(0)()); // 13
console.log(tbl.get(1)()); // 42

otherTable.set(0,tbl.get(0));
otherTable.set(1,tbl.get(1));

console.log(otherTable.get(0)());
console.log(otherTable.get(1)());
});
})
```

But when I use gltf-pipeline, it depences on your draco, and ,it fetch http://draco_encoder.wasm/
And error is ` no such file or directory, open '\draco_encoder.wasm'`

![image](https://user-images.githubusercontent.com/17426397/134304300-c414bfea-d3fe-46d8-9e73-8288c7d10a96.png)

how does draco change the base url?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.