#Just did a test with something, pnpm run

1 messages · Page 1 of 1 (latest)

foggy flume
#

Alright I've got some message errors in the console, not sure I understand them though

frank parrot
# foggy flume

findByProps didn't find anything. it's better to use DevCompanion to test functions such as findByProps right inside vscode, without having to build the app

foggy flume
# frank parrot findByProps didn't find anything. it's better to use DevCompanion to test functi...

I know, that's what I did but the error message is too cryptic
It just said Find bad: Failed to find: Found more than one result! Make this filter more specific
But the problem is that I don't know what it gets so I don't know what I could filter more
So I tried to build, to print the different results and see which ones I wanted to keep

I'm still learning so i'm tinkering, thanks for the help

frank parrot
#

to find the right module you can use sources tab in developer menu and ctrl + shift + f to search for props across all modules

foggy flume
# frank parrot you need to specify more props in your function, example below

tbh i'm propably doing it the wrong way but...
I had this part of a script that ran in the console : const api = Object.values(wpRequire.c).find(x => x?.exports?.tn?.get).exports.tn;
And i'm trying to recreate this api variable using const api = findByProps("get", "post", "put", "patch", "delete"); which doesn't work

frank parrot
#

you can use RestAPI object from webpack/common

foggy flume
frank parrot
foggy flume
frank parrot
#

if you have some feature you want to make in mind, you can look for plugins that do something similar and see how it's implemented there

#

that's how i learn at least

foggy flume