danieldiekmeier / textexpander-to-alfred3

Convert your TextExpander snippets to Alfred 3 snippets.
ISC License
62 stars 1 forks source link

Problem with `sanitize-filename` package #10

Closed zeitchef closed 5 years ago

zeitchef commented 5 years ago

There appears to be an issue with one of your dependencies.

❯ te2a3 Composers.textexpander
/usr/local/lib/node_modules/textexpander-to-alfred3/node_modules/sanitize-filename/index.js:41
    .replace(illegalRe, replacement)
     ^

TypeError: Cannot read property 'replace' of undefined
    at sanitize (/usr/local/lib/node_modules/textexpander-to-alfred3/node_modules/sanitize-filename/index.js:41:6)
    at module.exports (/usr/local/lib/node_modules/textexpander-to-alfred3/node_modules/sanitize-filename/index.js:51:16)
    at transformSnippet (/usr/local/lib/node_modules/textexpander-to-alfred3/textexpander-to-alfred3.js:29:15)
    at Array.map (<anonymous>)
    at textexpander2Alfred (/usr/local/lib/node_modules/textexpander-to-alfred3/textexpander-to-alfred3.js:71:6)
    at /usr/local/lib/node_modules/textexpander-to-alfred3/textexpander-to-alfred3.js:55:21
    at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:54:3)
shravansundaram commented 5 years ago

Is anyone able to fix this issue?

danieldiekmeier commented 5 years ago

This is probably not a problem with sanitize-filename, but with my bad code. I converted all my snippets over 3 years ago and haven't used TextExpander since, so I can't really do too much to help here.

But I looked at my code and there seemed to be a pretty obvious place where the bug probably originates, so I just published v0.1.2 which should fix it.

Can you update (using npm i -g textexpander-to-alfred3@0.1.2), and check if this fixed the problem?

shravansundaram commented 5 years ago

Doesn't seem like it fixed it. I tried to do some debugging and issue seems to be happening somewhere around here parsedPlist.snippetsTE2 .map(transformSnippet) The transformSnippet is not getting the right value or undefined value which is causing sanitize to error.

shravansundaram commented 5 years ago

Also seems like the website doesn't work either. It returns an error after hitting covert

danieldiekmeier commented 5 years ago

I‘m sorry, but I won‘t be able to help you.

Obviously the website uses the exact same conversion script, so if the script doesn‘t work, then the website will also not work.

matthewmcvickar commented 5 years ago

@shravansundaram This is fixed now!