Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when removing image: path must be a string #131

Open
stefanorie opened this issue Jul 25, 2017 · 2 comments
Open

Error when removing image: path must be a string #131

stefanorie opened this issue Jul 25, 2017 · 2 comments

Comments

@stefanorie
Copy link

So I'm trying to remove a image from my Images collection by using

Meteor.methods({
    removeImage(imageId) {
        if (!Meteor.userId()) {
            return;
        }
        check(imageId, String);
        Images.remove(imageId);
    },
});

However I get a error in the server logs stating: TypeError: path must be a string.

I20170725-13:08:42.210(2)? Exception in callback of async function: TypeError: path must be a string
I20170725-13:08:42.211(2)?     at Object.fs.stat (fs.js:682:11)
I20170725-13:08:42.211(2)?     at [object Object].self.delete (packages/jalik:ufs-local/ufs-local.js:97:16)
I20170725-13:08:42.211(2)?     at Object.<anonymous> (packages/jalik:ufs/ufs-store.js:406:13)
I20170725-13:08:42.212(2)?     at packages/matb33_collection-hooks/remove.js:32:1
I20170725-13:08:42.212(2)?     at Function._.each._.forEach (packages/underscore/underscore.js:108:1)
I20170725-13:08:42.212(2)?     at packages/matb33_collection-hooks/remove.js:31:1
I20170725-13:08:42.213(2)?     at Function._.each._.forEach (packages/underscore/underscore.js:108:1)
I20170725-13:08:42.213(2)?     at Object.CollectionHooks.defineAdvice.self (packages/matb33_collection-hooks/remove.js:30:1)
I20170725-13:08:42.213(2)?     at Object.collection.(anonymous function) [as remove] (packages/matb33_collection-hooks/collection-hooks.js:120:1)
I20170725-13:08:42.213(2)?     at [object Object].remove (packages/mongo/collection.js:624:29)

I double checked if the image I was removing had a path, and it did ('/home/stefan/uploads/images/campaigns/oPbhzZK6iyyAcLKYL.png'). I also checked the demo project to see if there was another way of removing images, but the demo also used .remove().

How can I fix this?

@superdevofficial
Copy link

Same problem.

@bouchepat
Copy link

Same problem as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants