expo-three icon indicating copy to clipboard operation
expo-three copied to clipboard

Possible Unhandled Promise Rejection (id: 0):

Open alexandrius opened this issue 5 years ago • 10 comments

Hello. Thanks for the library! I get this error when trying to load 3ds files. Obj files work just fine. Any thoughts why this might be happening

Possible Unhandled Promise Rejection (id: 0):
Object {
  "bubbles": false,
  "cancelable": false,
  "currentTarget": XMLHttpRequest {
    "DONE": 4,
    "HEADERS_RECEIVED": 2,
    "LOADING": 3,
    "OPENED": 1,
    "UNSENT": 0,
    "_aborted": false,
    "_cachedResponse": undefined,
    "_hasError": true,
    "_headers": Object {},
    "_incrementalEvents": true,
    "_lowerCaseResponseHeaders": Object {},
    "_method": "GET",
    "_requestId": null,
    "_response": "",
    "_responseType": "arraybuffer",
    "_sent": true,
    "_subscriptions": Array [],
    "_timedOut": false,
    "_trackingName": "unknown",
    "_url": "file:///data/user/0/host.exp.exponent/cache/ExperienceData/%2540alexandrius%252FMenuT/ExponentAsset-69b6af9f880511e31e20a76bb1454953.3ds",
    "readyState": 4,
    "responseHeaders": undefined,
    "status": 0,
    "timeout": 0,
    "upload": XMLHttpRequestEventTarget {
      Symbol(listeners): Object {},
    },
    "withCredentials": true,
    Symbol(listeners): Object {
      "error": Object {
        "kind": 2,
        "listener": [Function anonymous],
        "next": null,
      },
      "load": Object {
        "kind": 2,
        "listener": [Function anonymous],
        "next": null,
      },
      "progress": Object {
        "kind": 2,
        "listener": [Function anonymous],
        "next": null,
      },
    },
  },
  "eventPhase": 2,
  "isTrusted": false,
  "target": XMLHttpRequest {
    "DONE": 4,
    "HEADERS_RECEIVED": 2,
    "LOADING": 3,
    "OPENED": 1,
    "UNSENT": 0,
    "_aborted": false,
    "_cachedResponse": undefined,
    "_hasError": true,
    "_headers": Object {},
    "_incrementalEvents": true,
    "_lowerCaseResponseHeaders": Object {},
    "_method": "GET",
    "_requestId": null,
    "_response": "",
    "_responseType": "arraybuffer",
    "_sent": true,
    "_subscriptions": Array [],
    "_timedOut": false,
    "_trackingName": "unknown",
    "_url": "file:///data/user/0/host.exp.exponent/cache/ExperienceData/%2540alexandrius%252FMenuT/ExponentAsset-69b6af9f880511e31e20a76bb1454953.3ds",
    "readyState": 4,
    "responseHeaders": undefined,
    "status": 0,
    "timeout": 0,
    "upload": XMLHttpRequestEventTarget {
      Symbol(listeners): Object {},
    },
    "withCredentials": true,
    Symbol(listeners): Object {
      "error": Object {
        "kind": 2,
        "listener": [Function anonymous],
        "next": null,
      },
      "load": Object {
        "kind": 2,
        "listener": [Function anonymous],
        "next": null,
      },
      "progress": Object {
        "kind": 2,
        "listener": [Function anonymous],
        "next": null,
      },
    },
  },
  "timeStamp": 1553355759835,
  "type": "error",
  Symbol(stop_immediate_propagation_flag): false,
  Symbol(canceled_flag): false,
  Symbol(original_event): Object {
    "type": "error",
  },
}

This is my metro.config.js

module.exports = {
    resolver: {
        assetExts: ["db", "mp3", "ttf", "obj", "png", "jpg", "otf", "mtl", "3ds"]
    }
};

Thanks!

alexandrius avatar Mar 23 '19 15:03 alexandrius

This is my code

    const model = {
      'guitar.3ds': require(`./assets/models/guitar.3ds`),
      'gibson_50th_anniversary_1958_les_paul_bk2.jpg': require('./assets/models/gibson_50th_anniversary_1958_les_paul_bk2.jpg'),
      's_aberdeen_oak2222.jpg': require('./assets/models/s_aberdeen_oak2222.jpg'),
      's_aberdeen_oak2222bump.jpg': require('./assets/models/s_aberdeen_oak2222bump.jpg'),
    };

    const mesh = await ExpoTHREE.loadAsync(
      model['guitar.3ds'],
      null,
      name => model[name]
    );


    const normal = await ExpoTHREE.loadAsync(model['s_aberdeen_oak2222bump.jpg']);

    mesh.traverse(function (child) {
      if (child instanceof THREE.Mesh) {
        child.material.normalMap = normal;
      }
    });
    ExpoTHREE.utils.scaleLongestSideToSize(mesh, 3);
    ExpoTHREE.utils.alignMesh(mesh, { y: 1 });
    this.scene.add(mesh);
    this.cube = mesh;

alexandrius avatar Mar 23 '19 15:03 alexandrius

I have the same problem. Did you find a solution?

kantedal avatar Apr 11 '19 18:04 kantedal

Unfortunately no

alexandrius avatar Apr 11 '19 19:04 alexandrius

hello any solution?

x5engine avatar Oct 14 '19 21:10 x5engine

Same problem with fbx file

timnlupo avatar Dec 03 '19 03:12 timnlupo

Same with dae , glb and gltf extensions

enzopoeta avatar Jan 06 '20 11:01 enzopoeta

similar with gltf. any solution yet?

ulvido avatar Jul 13 '20 08:07 ulvido

got any solutions for this?

p4tric avatar Sep 19 '20 08:09 p4tric

@p4tric see #151 , there are some solutions that worked for me

timnlupo avatar Sep 19 '20 17:09 timnlupo

Tried using asset.uri instead of asset.localUri and Android works in debug mode, but when distributed via APK, it fails to load the uri due to it being local.. (file:///)

swittk avatar Sep 22 '20 02:09 swittk