nybbles / obsidian-pocket

Pocket integration for Obsidian
MIT License
237 stars 23 forks source link

I get 'Failed to create file' when trying to make a note from an item. Windows 11. #97

Open apotenza92 opened 2 years ago

apotenza92 commented 2 years ago

image Comes up with Windows dialogue to select an application but I can't choose anything. Looks like some failure for Obsidian to open the link created when trying to make a note.

nybbles commented 2 years ago

Were you trying to create a new Pocket item note by clicking on the Pocket item's title on the Pocket list?

nybbles commented 2 years ago

Please provide console logs from after encountering this error. You can copy/paste console logs from the Obsidian dev console, which can be opened by going to View > Toggle Developer Tools in Obsidian.

apotenza92 commented 2 years ago

Yes trying to make note in that way.

Here's a console log that occurs:

Failed to create file for Umbra TypeError: Cannot read properties of undefined (reading 'replace') at getItemNotesFolder (eval at <anonymous> (app.js:1:1494667), <anonymous>:31024:63) at eval (eval at <anonymous> (app.js:1:1494667), <anonymous>:31221:33) at Generator.next (<anonymous>) at fulfilled (eval at <anonymous> (app.js:1:1494667), <anonymous>:25:58) eval @ VM421:31230

nybbles commented 2 years ago

Hm I think I know what's going on - could you double-check that your folder for Pocket item notes is either blank (so it'll use root folder by default), or is a valid folder?

I need to actually detect this error and show an error message so the user knows what's going on, but I think this is what might be happening in your case.

apotenza92 commented 2 years ago

I tried both with and without a specified folder. Neither worked, unfortunately.

halbtagsprogrammierer commented 2 years ago

I get the error "Failed to create file" too. But I'm on Windows 10.

It seems, that with every poket item this error occurs:

File name cannot contain any of the following characters: * " \ / < > : | ?

My Console Log:

Loading Pocket plugin
plugin:obsidian-pocket:31236 Failed to create file for https scholarsandrogues.files.wordpress.com 2015 05 zinsser-book.jpeg Error: File name cannot contain any of the following characters: * " \ / < > : | ?
    at Pe (app.js:1:248253)
    at t.checkPath (app.js:1:1082022)
    at t.<anonymous> (app.js:1:1083907)
    at app.js:1:235201
    at Object.next (app.js:1:235306)
    at app.js:1:234243
    at new Promise (<anonymous>)
    at m (app.js:1:233988)
    at t.create (app.js:1:1083795)
    at eval (plugin:obsidian-pocket:31231:39)
eval @ plugin:obsidian-pocket:31236
app.js:1 Uncaught (in promise) Error: File name cannot contain any of the following characters: * " \ / < > : | ?
    at Pe (app.js:1:248253)
    at t.checkPath (app.js:1:1082022)
    at t.<anonymous> (app.js:1:1084683)
    at app.js:1:235201
    at Object.next (app.js:1:235306)
    at app.js:1:234243
    at new Promise (<anonymous>)
    at m (app.js:1:233988)
    at t.createFolder (app.js:1:1084573)
    at eval (plugin:obsidian-pocket:30675:15)
app.js:1 Received URL action Object
plugin:obsidian-pocket:31924 Fetching with Pocket item updates since 25.11.2022, 21:09:38
plugin:obsidian-pocket:31931 Pocket items fetched.
plugin:obsidian-pocket:31263 Failed to create file for Writing docs well   why should a software engineer care    Hacker News Error: File name cannot contain any of the following characters: * " \ / < > : | ?
    at Pe (app.js:1:248253)
    at t.checkPath (app.js:1:1082022)
    at t.<anonymous> (app.js:1:1083907)
    at app.js:1:235201
    at Object.next (app.js:1:235306)
    at app.js:1:234243
    at new Promise (<anonymous>)
    at m (app.js:1:233988)
    at t.create (app.js:1:1083795)
    at eval (plugin:obsidian-pocket:31253:34)
eval @ plugin:obsidian-pocket:31263
plugin:obsidian-pocket:31263 Failed to create file for https scholarsandrogues.files.wordpress.com 2015 05 zinsser-book.jpeg Error: File name cannot contain any of the following characters: * " \ / < > : | ?
    at Pe (app.js:1:248253)
    at t.checkPath (app.js:1:1082022)
    at t.<anonymous> (app.js:1:1083907)
    at app.js:1:235201
    at Object.next (app.js:1:235306)
    at app.js:1:234243
    at new Promise (<anonymous>)
    at m (app.js:1:233988)
    at t.create (app.js:1:1083795)
    at eval (plugin:obsidian-pocket:31253:34)
eval @ plugin:obsidian-pocket:31263
plugin:obsidian-pocket:31263 Failed to create file for DHCP reservation is not replicated to the DHCP Hotstandby serve Error: File name cannot contain any of the following characters: * " \ / < > : | ?
    at Pe (app.js:1:248253)
    at t.checkPath (app.js:1:1082022)
    at t.<anonymous> (app.js:1:1083907)
    at app.js:1:235201
    at Object.next (app.js:1:235306)
    at app.js:1:234243
    at new Promise (<anonymous>)
    at m (app.js:1:233988)
    at t.create (app.js:1:1083795)
    at eval (plugin:obsidian-pocket:31253:34)
eval @ plugin:obsidian-pocket:31263
app.js:1 Uncaught (in promise) Error: File name cannot contain any of the following characters: * " \ / < > : | ?
    at Pe (app.js:1:248253)
    at t.checkPath (app.js:1:1082022)
    at t.<anonymous> (app.js:1:1084683)
    at app.js:1:235201
    at Object.next (app.js:1:235306)
    at app.js:1:234243
    at new Promise (<anonymous>)
    at m (app.js:1:233988)
    at t.createFolder (app.js:1:1084573)
    at eval (plugin:obsidian-pocket:30675:15)
plugin:obsidian-pocket:31236 Failed to create file for Writing docs well   why should a software engineer care    Hacker News Error: File name cannot contain any of the following characters: * " \ / < > : | ?
    at Pe (app.js:1:248253)
    at t.checkPath (app.js:1:1082022)
    at t.<anonymous> (app.js:1:1083907)
    at app.js:1:235201
    at Object.next (app.js:1:235306)
    at app.js:1:234243
    at new Promise (<anonymous>)
    at m (app.js:1:233988)
    at t.create (app.js:1:1083795)
    at eval (plugin:obsidian-pocket:31231:39)
eval @ plugin:obsidian-pocket:31236
rejected @ plugin:obsidian-pocket:26
Promise.then (async)
step @ plugin:obsidian-pocket:27
fulfilled @ plugin:obsidian-pocket:25
Promise.then (async)
step @ plugin:obsidian-pocket:27
fulfilled @ plugin:obsidian-pocket:25
Promise.then (async)
step @ plugin:obsidian-pocket:27
eval @ plugin:obsidian-pocket:28
__awaiter @ plugin:obsidian-pocket:24
eval @ plugin:obsidian-pocket:31219
eval @ plugin:obsidian-pocket:32446
eval @ plugin:obsidian-pocket:28
__awaiter @ plugin:obsidian-pocket:24
onClick @ plugin:obsidian-pocket:32437
callCallback @ plugin:obsidian-pocket:7988
invokeGuardedCallbackDev @ plugin:obsidian-pocket:8037
invokeGuardedCallback @ plugin:obsidian-pocket:8099
invokeGuardedCallbackAndCatchFirstError @ plugin:obsidian-pocket:8113
executeDispatch @ plugin:obsidian-pocket:12286
processDispatchQueueItemsInOrder @ plugin:obsidian-pocket:12318
processDispatchQueue @ plugin:obsidian-pocket:12331
dispatchEventsForPlugins @ plugin:obsidian-pocket:12342
eval @ plugin:obsidian-pocket:12550
batchedEventUpdates$1 @ plugin:obsidian-pocket:26425
batchedEventUpdates @ plugin:obsidian-pocket:7788
dispatchEventForPluginEventSystem @ plugin:obsidian-pocket:12549
attemptToDispatchEvent @ plugin:obsidian-pocket:10048
dispatchEvent @ plugin:obsidian-pocket:9967
unstable_runWithPriority @ plugin:obsidian-pocket:3203
runWithPriority$1 @ plugin:obsidian-pocket:15316
discreteUpdates$1 @ plugin:obsidian-pocket:26442
discreteUpdates @ plugin:obsidian-pocket:7799
dispatchDiscreteEvent @ plugin:obsidian-pocket:9932
app.js:1 Uncaught (in promise) Error: File name cannot contain any of the following characters: * " \ / < > : | ?
    at Pe (app.js:1:248253)
    at t.checkPath (app.js:1:1082022)
    at t.<anonymous> (app.js:1:1084683)
    at app.js:1:235201
    at Object.next (app.js:1:235306)
    at app.js:1:234243
    at new Promise (<anonymous>)
    at m (app.js:1:233988)
    at t.createFolder (app.js:1:1084573)
    at eval (plugin:obsidian-pocket:30675:15)
Pe @ app.js:1
t.checkPath @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
m @ app.js:1
t.createFolder @ app.js:1
eval @ plugin:obsidian-pocket:30675
fulfilled @ plugin:obsidian-pocket:25
Promise.then (async)
step @ plugin:obsidian-pocket:27
fulfilled @ plugin:obsidian-pocket:25
Promise.then (async)
step @ plugin:obsidian-pocket:27
eval @ plugin:obsidian-pocket:28
__awaiter @ plugin:obsidian-pocket:24
ensureFolderExists @ plugin:obsidian-pocket:30670
eval @ plugin:obsidian-pocket:31227
fulfilled @ plugin:obsidian-pocket:25
Promise.then (async)
step @ plugin:obsidian-pocket:27
eval @ plugin:obsidian-pocket:28
__awaiter @ plugin:obsidian-pocket:24
eval @ plugin:obsidian-pocket:31219
eval @ plugin:obsidian-pocket:32446
eval @ plugin:obsidian-pocket:28
__awaiter @ plugin:obsidian-pocket:24
onClick @ plugin:obsidian-pocket:32437
callCallback @ plugin:obsidian-pocket:7988
invokeGuardedCallbackDev @ plugin:obsidian-pocket:8037
invokeGuardedCallback @ plugin:obsidian-pocket:8099
invokeGuardedCallbackAndCatchFirstError @ plugin:obsidian-pocket:8113
executeDispatch @ plugin:obsidian-pocket:12286
processDispatchQueueItemsInOrder @ plugin:obsidian-pocket:12318
processDispatchQueue @ plugin:obsidian-pocket:12331
dispatchEventsForPlugins @ plugin:obsidian-pocket:12342
eval @ plugin:obsidian-pocket:12550
batchedEventUpdates$1 @ plugin:obsidian-pocket:26425
batchedEventUpdates @ plugin:obsidian-pocket:7788
dispatchEventForPluginEventSystem @ plugin:obsidian-pocket:12549
attemptToDispatchEvent @ plugin:obsidian-pocket:10048
dispatchEvent @ plugin:obsidian-pocket:9967
unstable_runWithPriority @ plugin:obsidian-pocket:3203
runWithPriority$1 @ plugin:obsidian-pocket:15316
discreteUpdates$1 @ plugin:obsidian-pocket:26442
discreteUpdates @ plugin:obsidian-pocket:7799
dispatchDiscreteEvent @ plugin:obsidian-pocket:9932

That happens with all my Pocket items.

khanhtoan529 commented 1 year ago

I have same issue here. I save a post into pocket (Link post)

But when I clicked the title to create a note, it shows "Failed to create file for"

My console log: Failed to create file for How many hours do you work per week, and how flexible is your role TypeError: Cannot read properties of undefined (reading 'replace') at getItemNotesFolder (plugin:obsidian-pocket:31030:63) at eval (plugin:obsidian-pocket:31227:33) at Generator.next (<anonymous>) at fulfilled (plugin:obsidian-pocket:25:58)

erdivartanovich commented 1 year ago

I got same issue, and create a PR. Probably this issue related, @nybbles please check my PR https://github.com/nybbles/obsidian-pocket/pull/110

SamClayton commented 1 month ago

On MacOS Monterey, I'm getting the same TypeScript error with the default/undefined folder setting when attempting to create a note.

plugin:obsidian-pocket:31236 Failed to create file for Lithuania installs ‘dragon’s teeth’ to fend off potential Russian attack TypeError: Cannot read properties of undefined (reading 'replace') at getItemNotesFolder (plugin:obsidian-pocket:31030:63) at eval (plugin:obsidian-pocket:31227:33) at Generator.next (<anonymous>) at fulfilled (plugin:obsidian-pocket:25:58)

Also seen: Uncaught (in promise) TypeError: Cannot read properties of null (reading 'frontmatter') at URLToPocketItemNoteIndex.eval (plugin:obsidian-pocket:30859:66) at Generator.next (<anonymous>) at eval (plugin:obsidian-pocket:28:71)