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 opening "My PromptLab Commands" #8

Open
alexzadeh opened this issue May 13, 2023 · 10 comments
Open

Error when opening "My PromptLab Commands" #8

alexzadeh opened this issue May 13, 2023 · 10 comments

Comments

@alexzadeh
Copy link

alexzadeh commented May 13, 2023

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

@SKaplanOfficial
Copy link
Owner

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 🙂

@alexzadeh
Copy link
Author

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?

@SKaplanOfficial
Copy link
Owner

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.

@halliwells99
Copy link

halliwells99 commented May 14, 2023

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
Copy link

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

@halliwells99
Copy link

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

@SKaplanOfficial
Copy link
Owner

@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...

@halliwells99
Copy link

@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
Copy link

error message:

@halliwells99
Copy link

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()

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