ProxymanApp / ProxymanApp/Proxyman
Invalid Promise object in Script runner breaks require of full lodash suite
Open
@NghiaTranUIT is already working on this.
Since Dec 17, 2023.
✅ Done
bug
- Dominant language
- No language data
- Stars
- 7k
- Forks
- 237
- PR merge metrics
- No merged PRs in 30d
Description
Description
The Promise object in the Script runner does not support Promise.resolve.
The solution is either to remove the invalid Promise object or implement full support.
Uncomment the code in the example script below to watch it run correctly.
Steps to Reproduce
- Download the full package of lodash to user scripts location:
curl https://raw.githubusercontent.com/lodash/lodash/4.17.15-npm/lodash.min.js \
> ~/Library/Application\ Support/com.proxyman.NSProxy/users/lodash.min.js
- Create a script which uses lodash:
/*
Uncomment the next line to make it work as a quick fix
*/
// delete(Promise);
const lodash = require("@users/lodash.min.js")
const object = { 'a': [{ 'b': { 'c': 3 } }] };
console.log(lodash.get(object, 'a[0].b.c'));
- Make a trigger and trigger it
Current Behavior
Lodash fails to load because Promise.resolve doesn't exist with error: "[...].resolve is not a function"
Expected Behavior
It should have executed and logged the value 3 to the console
Environment
- App version: Version 3.12.0 (31200
- macOS version: macOS Monterey
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.