Raycast-PromptLab icon indicating copy to clipboard operation
Raycast-PromptLab copied to clipboard

Error when opening "My PromptLab Commands"

Open alexzadeh opened this issue 3 years ago • 10 comments

Hi,

I installed your extension earlier today and it's fantastic. It was working fine but now when I go to 'My PromptLab Commands' I get the following error:


TypeError: command.acceptedFileExtensions?.split is
not a function
SearchCommand:search-commands.tsx:27:2

24: import path from "path";
25: 
26: export default function SearchCommand(props: { arguments: { commandName: string; queryInput: string } }) {
27:   const { commandName, queryInput } = props.arguments;
     ^
28:   const [commands, setCommands] = useState<Command[]>();
29:   const [targetCategory, setTargetCategory] = useState<string>("All");
30:   const [searchText, setSearchText] = useState<string | undefined>(

SearchCommand:search-commands.tsx:27:2
Nr:index.js:6:2490
    at ray-navigation-stack
_o:index.js:6:2088

Finder - prompt-sets - 13-05-2023 - 20 11 01@2x

I installed a few batches of commands from the store. Most worked well. One issue I had, almost certainly unrelated, was when summarising PDF with filename Walter Murch - In the Blink of an Eye Revised 2nd Edition (2001, Silman-James Pr).pdf, it didn't like it and gave me the error:

Error: ENOENT: no such file or directory, Istat '/Users/
Alex/Downloads/Walter Murch - In the Blink of an Eye
Revised 2nd Edition (2001'
Obiect.IstatSync:node:fs:1569:3

![Finder - Downloads - 13-05-2023 - 20 14 22@2x](https://github.com/SKaplanOfficial/Raycast-PromptLab/assets/11060179/c47d2ea3-d6ad-411e-8d39-747765fa2813)

Renaming it to test.pdf worked and then everything seemed fine after.

The last command I tried to run was 'summarise spoken audio' which gave me an error that unfortunately I didn't capture.

Thanks,

Alex

alexzadeh avatar May 13 '23 19:05 alexzadeh

I've just pushed fixes for both of these. The first was caused by some commands having "None" in the acceptedFileExtensions field, which is now accounted for. The second issue was caused by splitting the list of selected files using , as a delimiter — I'm using :: now instead.

When you get a chance, please confirm that the issues are fixed on your end 🙂

SKaplanOfficial avatar May 13 '23 20:05 SKaplanOfficial

Thanks for the quick feedback and fixes. The summarisation filename issue is fixed but I still get the same error with My PromptLab Commands. Is there anything I can do to help you diagnose it further?

alexzadeh avatar May 14 '23 11:05 alexzadeh

Hm, strange. I've tried reinstalling all of the commands from the store, and none cause this error for me.

I'd like to analyze the JSON config for the commands you've got installed to see if there's anything strange there. Normally you could get that via the action menu in the command list... For this case, can you look in /Users/exampleUser/Library/Application Support/com.raycast.macos/extensions/promptlab/com.raycast.api.cache/ and share the file with random characters as a name, e.g. kMNvFzpyCwuRjqwY4gTBH? You can DM it to me on the Raycast slack if you'd like.

SKaplanOfficial avatar May 14 '23 18:05 SKaplanOfficial

I'M GETTING the same error. HAPPENS AFTER I install a script from the store, when I RETURN to my promptlab commands I get this error: TypeError: command.acceptedFileExtensions?.split is not a function SearchCommand:search-commands.tsx:27:2

halliwells99 avatar May 14 '23 23:05 halliwells99

I can only fix the issue by a complete reinstall through terminal again. For now I'm not using the store command

halliwells99 avatar May 14 '23 23:05 halliwells99

It's a fabulous tool, hope you can fix this bug

halliwells99 avatar May 14 '23 23:05 halliwells99

@halliwells99 The issue appears to be fixed in the latest version, but you have to clear the extension storage and cache for the fix to apply. You can do that by opening the Actions menu on any PromptLab command in Raycast's root search, then running the Clear Local Storage & Cache action. Note that this will delete any custom commands you have installed. I am still investigating other fixes...

SKaplanOfficial avatar May 15 '23 15:05 SKaplanOfficial

@halliwells99 The issue appears to be fixed in the latest version, but you have to clear the extension storage and cache for the fix to apply. You can do that by opening the Actions menu on any PromptLab command in Raycast's root search, then running the Clear Local Storage & Cache action. Note that this will delete any custom commands you have installed. I am still investigating other fixes...

Thanks for your response but sadly the extension keeps crashing with the same error message. I did delete the storage and cache as outlined above

halliwells99 avatar May 15 '23 22:05 halliwells99

error message:

halliwells99 avatar May 15 '23 22:05 halliwells99

22: import { getCommandJSON } from "./utils/command-utils"; 23: 24: export default function SearchCommand(props: { arguments: { commandName: string; queryInput: string } }) { 25: const { commandName, queryInput } = props.arguments; ^ 26: const [commands, setCommands] = useState<Command[]>(); 27: const [searchText, setSearchText] = useState<string | undefined>( 28: commandName == undefined || queryInput ? undefined : commandName.trim()

halliwells99 avatar May 15 '23 22:05 halliwells99