-
Notifications
You must be signed in to change notification settings - Fork 29
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
[BUG] Node sub dependency not resolving #399
Comments
Hi @emilygarner thanks for writing in! In short when running It seems like you may need to specifically configure the subdependency for the HTTPS import used by the parent dependency. This may be tricky, I suspect that specifying Let me know if this helps resolve the issue, else would you be able to share some source code that allows me to reproduce your error? |
For the source code: The only npm package I am importing is jsforce, so that should help reproduce the issue. I am not sure how to specifically configure the HTTPS import for jsforce |
I was able to reproduce this issue 👍 Ive opened this PR to improve support for npm libraries in our bundling logic. Unfortunately this does not seem to resolve your issue, even with these changes I am still seeing your error at runtime 🤔 It seems like the |
Is there any solution to this that we can use? |
There are a few solutions that come to mind
|
Hi @WilliamBergamin Thank you for the suggestions, I am testing out a different nom package now to see if that will work but now I am getting an error when I run slack deploy. I am getting a ton of: |
Are you using the following {
"hooks": {
"get-hooks": "deno run -q --allow-read --allow-net https://deno.land/x/[email protected]/mod.ts",
"build": "deno run -q --config=deno.jsonc --allow-read --allow-write --allow-net --allow-run --allow-env --allow-sys=osRelease https://raw.githubusercontent.com/slackapi/deno-slack-hooks/refs/heads/main/src/build.ts"
}
} Could you please share this new library so I can try to reproduce this error |
Yes I used that as my slack.json and it is still not working. I am importing "simple-oauth2" and "node-fetch" |
You shouldn't need |
Yess, I would also suggest using Deno fetch rather then importing an npm package |
Using that, I am able to deploy but get the following error |
Do you get this error when executing |
Everything works with slack run |
Would you be able share more context on how to reproduce this error? |
simple-oauth2 is now the only npm package I am importing. The only other change is I am now using fetch to make a post request with headers. |
@WilliamBergamin Here is my source code for my function that is inside a try catch block:
Again it works with slack run, not slack deploy |
Some more context on the bundling behavior of this SDK. This SDK originally relied on the native I found this issue that seems to indicate that I would suggest hand rolling your OAuth flow or using a Deno native library like oauth2-client |
The
deno-slack
versions"deno-slack-hub/": "https://deno.land/x/[email protected]/",
"deno-slack-sdk/": "https://deno.land/x/[email protected]/",
"deno-slack-api/": "https://deno.land/x/[email protected]/",
Deno runtime version
deno 2.1.4 (stable, release, aarch64-apple-darwin)
v8 13.0.245.12-rusty
typescript 5.6.2
OS info
ProductName: macOS
ProductVersion: 14.3
BuildVersion: 23D56
Darwin Kernel Version 23.3.0: Wed Dec 20 21:30:44 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T6000
Describe the bug
One of my slack functions is not running after deployment. On "slack run" it works perfect, but after deploying my workflow to slack it will not run. I get the following error:
Function output: Caught error from user supplied module: TypeError: Relative import path "querystring" not prefixed with / or ./ or ../ If you want to use a built-in Node module, add a "node:" prefix (ex. "node:querystring").
This error is strange because I am not using querystring anywhere in my program, so I believe it is a sub dependency of another npm package I am using. However, even after adding "querystring : node:querystring" to my import map AND scopes, the problem still persists. Any help on this would be greatly appreciated.
The text was updated successfully, but these errors were encountered: