Skip to content

Error addItems setImmediate is not defined #76

@sebastian-baier

Description

@sebastian-baier

code:

const users = new Users({ endpoint: 'wss://auth.space.storage' });
    const id = await users.createIdentity();
    const user = await users.authenticate(id);

    const storage = new UserStorage(user);
    await storage.createFolder({ bucket: 'personal', path: '' });

    const response = await storage.addItems({
      bucket: 'personal',
      files: [
        {
          path: 'file.txt',
          data: '',
          mimeType: 'plain/text',
        },
      ],
    });

    response.once('done', (data: AddItemsEventData) => {
      const summary = data as AddItemsResultSummary;
    });

Error:

- ERROR Error: Uncaught (in promise): ReferenceError: setImmediate is not defined
mDXs/</addItems/<@http://localhost:4200/vendor.js:231085:13
fulfilled@http://localhost:4200/vendor.js:230510:58
invoke@http://localhost:4200/polyfills.js:4777:30
onInvoke@http://localhost:4200/vendor.js:186616:33
invoke@http://localhost:4200/polyfills.js:4776:36
run@http://localhost:4200/polyfills.js:4536:47
scheduleResolveOrReject/<@http://localhost:4200/polyfills.js:5270:40
invokeTask@http://localhost:4200/polyfills.js:4812:35
onInvokeTask@http://localhost:4200/vendor.js:186603:33
invokeTask@http://localhost:4200/polyfills.js:4811:40
runTask@http://localhost:4200/polyfills.js:4580:51
drainMicroTaskQueue@http://localhost:4200/polyfills.js:4982:39
invokeTask@http://localhost:4200/polyfills.js:4897:25
ZoneTask/this.invoke@http://localhost:4200/polyfills.js:4882:52
timer@http://localhost:4200/polyfills.js:6965:33
setTimeout handler*scheduleTask@http://localhost:4200/polyfills.js:6986:39
scheduleTask@http://localhost:4200/polyfills.js:4798:30
onScheduleTask@http://localhost:4200/polyfills.js:4685:69
scheduleTask@http://localhost:4200/polyfills.js:4791:55
scheduleTask@http://localhost:4200/polyfills.js:4623:47
scheduleMacroTask@http://localhost:4200/polyfills.js:4646:29
scheduleMacroTaskWithCurrentZone@http://localhost:4200/polyfills.js:5547:29
patchTimer/setNative</<@http://localhost:4200/polyfills.js:6999:66
patchMethod/proto[name]@http://localhost:4200/polyfills.js:5862:52
nifk/</e.exports</t.default@http://localhost:4200/vendor.js:236405:1525
nifk/</e.exports</e.prototype.rawOnEnd/<@http://localhost:4200/vendor.js:236405:5282
nifk/</e.exports</e.prototype.rawOnEnd@http://localhost:4200/vendor.js:236405:5259
nifk/</e.exports</e.prototype.onTransportEnd@http://localhost:4200/vendor.js:236405:4417
nifk/</p/start/r.onclose@http://localhost:4200/vendor.js:236405:29476
wrapFn@http://localhost:4200/polyfills.js:5631:43
invokeTask@http://localhost:4200/polyfills.js:4812:35
onInvokeTask@http://localhost:4200/vendor.js:186603:33
invokeTask@http://localhost:4200/polyfills.js:4811:40
runTask@http://localhost:4200/polyfills.js:4580:51
invokeTask@http://localhost:4200/polyfills.js:4893:38
invokeTask@http://localhost:4200/polyfills.js:6034:18
globalZoneAwareCallback@http://localhost:4200/polyfills.js:6060:31
EventListener.handleEvent*customScheduleGlobal@http://localhost:4200/polyfills.js:6186:47
scheduleTask@http://localhost:4200/polyfills.js:4798:30
onScheduleTask@http://localhost:4200/polyfills.js:4685:69
scheduleTask@http://localhost:4200/polyfills.js:4791:55
scheduleTask@http://localhost:4200/polyfills.js:4623:47
scheduleEventTask@http://localhost:4200/polyfills.js:4649:29
makeAddListener/<@http://localhost:4200/polyfills.js:6341:39
patchProperty/desc.set@http://localhost:4200/polyfills.js:5692:24
start@http://localhost:4200/vendor.js:236405:29411
nifk/</e.exports</e.prototype.start@http://localhost:4200/vendor.js:236405:6409
nifk/</e.exports</t.unary@http://localhost:4200/vendor.js:236405:24934
nifk/</unary/<@http://localhost:4200/vendor.js:236405:30002
ZoneAwarePromise@http://localhost:4200/polyfills.js:5373:33
unary@http://localhost:4200/vendor.js:236405:29895
bucketsList/<@http://localhost:4200/vendor.js:121936:506821
__awaiter/<@http://localhost:4200/vendor.js:121936:291
ZoneAwarePromise@http://localhost:4200/polyfills.js:5373:33
__awaiter@http://localhost:4200/vendor.js:121936:36
bucketsList@http://localhost:4200/vendor.js:121936:506703
list/<@http://localhost:4200/vendor.js:121936:521012
__awaiter/<@http://localhost:4200/vendor.js:121936:291
ZoneAwarePromise@http://localhost:4200/polyfills.js:5373:33
__awaiter@http://localhost:4200/vendor.js:121936:36
list@http://localhost:4200/vendor.js:121936:520932
_getOrCreate/<@http://localhost:4200/vendor.js:121936:519768
    Angular 2
    rejected tslib.es6.js:74
    Angular 22
    default index.js:1
    rawOnEnd index.js:1
    rawOnEnd index.js:1
    onTransportEnd index.js:1
    onclose index.js:1
    Angular 16
    start index.js:1
    start index.js:1
    unary index.js:1
    unary index.js:1
    ZoneAwarePromise Angular
    unary index.js:1
    bucketsList index.js:16
    __awaiter index.js:16
    ZoneAwarePromise Angular
    __awaiter index.js:16
    bucketsList index.js:16
    list index.js:16
    __awaiter index.js:16
    ZoneAwarePromise Angular
    __awaiter index.js:16
    list index.js:16
    _getOrCreate index.js:16
core.js:6142

info:

@spacehq/sdk: 0.0.30
Angular v11.1.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions