Skip to content

Since Meteor 2.11 - Exception in setTimeout callback: TypeError: fs.remove is not a function #870

@Gobliins

Description

@Gobliins

Hello,

after upgrading to Meteor 2.11 / Mongo 6, I get the mentioned error.

My Code, Serverside:

function loadFile() {
  ...
  return new Promise((resolve, reject) => {
    Files.load(loadUrl, options,
      (loadError, fileRef) => {
        if (loadError) {
          return reject({error: loadError});
        } else {
          return resolve({error: false, fileRef});
        }
      }, true);
  });
}

When i call this function with await, it never resolves nor rejects.
When using .then(), i get the described error:

Exception in setTimeout callback: TypeError: fs.remove is not a function
at onEnd (packages/ostrio:files/server.js:1433:18) 
at packages/ostrio:files/server.js:1480:13
at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1329:12)
at packages/meteor.js:587:25
at runWithEnvironment (packages/meteor.js:1417:24)

On Meteor 2.10 it was working ok.

Is there an update needed or has something changed with Promises in Node 14 / Meteor 2.11?

Edit:
Removed the promise code and worked with callbacks, but still hangs on Files.load().

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions