Comments (4)
Thank you! I ended up getting it to work by changing to a fixed URL via ngrok however it now creates an error every time an event is received but still manages to execute the events normally and works otherwise fine.
[ERROR] bolt-app 20 | ErrorCode["UnknownError"] = "slack_bolt_unknown_error"; 21 | ErrorCode["WorkflowStepInitializationError"] = "slack_bolt_workflow_step_initialization_error"; 22 | })(ErrorCode = exports.ErrorCode || (exports.ErrorCode = {})); 23 | class UnknownError extends Error { 24 | constructor(original) { 25 | super(original.message); ^ error: JSGlobalProxy is not a constructor code: "slack_bolt_unknown_error" at new UnknownError (/home/kierank/Documents/Projects/the-old-man/node_modules/@slack/bolt/dist/errors.js:25:9) at asCodedError (/home/kierank/Documents/Projects/the-old-man/node_modules/@slack/bolt/dist/errors.js:35:12) at handleError (/home/kierank/Documents/Projects/the-old-man/node_modules/@slack/bolt/dist/App.js:612:35) [ERROR] An unhandled error occurred while Bolt processed an event [ERROR] bolt-app 20 | ErrorCode["UnknownError"] = "slack_bolt_unknown_error"; 21 | ErrorCode["WorkflowStepInitializationError"] = "slack_bolt_workflow_step_initialization_error"; 22 | })(ErrorCode = exports.ErrorCode || (exports.ErrorCode = {})); 23 | class UnknownError extends Error { 24 | constructor(original) { 25 | super(original.message); ^ error: JSGlobalProxy is not a constructor code: "slack_bolt_unknown_error" at new UnknownError (/home/kierank/Documents/Projects/the-old-man/node_modules/@slack/bolt/dist/errors.js:25:9) at asCodedError (/home/kierank/Documents/Projects/the-old-man/node_modules/@slack/bolt/dist/errors.js:35:12) at handleError (/home/kierank/Documents/Projects/the-old-man/node_modules/@slack/bolt/dist/App.js:612:35) [ERROR] An unhandled error occurred while Bolt processed an event
This error would happen if some code did new globalThis
or new global
.
Most likely, somewhere the this
value is (incorrectly) set to globalThis
and then some other code calls new this
. If a dependency is using vm
that could also be related.
Either way though, this is a bug in Bun and not in @slack/bolt
. Feel free to open an issue in Bun's github repository.
from bolt-js.
Hey @kcoderhtml! 👋 Thanks for writing in! It's neat to see some bun
use with @slack/bolt
!
I'm not immediately sure of what causes this, but I believe it's something related to the bun
runtime 🤔 When testing this with bun
I find the same debug logs without a message being sent to channel, but node
responds in channel as expected.
This isn't ideal (it'd be better if it worked) but makes sense to me since @slack/bolt
is backed by @slack/web-api
which is a part of the slackapi/node-slack-sdk. For that reason I don't believe a fix will be prioritized at this time (larger changes seem to be required) but perhaps the unofficial but well-maintained slack-edge can offer the bun
support?
In any case let's leave this issue open for a while in case other discoveries are made or if other troubles are existing with say
!
from bolt-js.
Thank you! I ended up getting it to work by changing to a fixed URL via ngrok however it now creates an error every time an event is received but still manages to execute the events normally and works otherwise fine.
[ERROR] bolt-app 20 | ErrorCode["UnknownError"] = "slack_bolt_unknown_error";
21 | ErrorCode["WorkflowStepInitializationError"] = "slack_bolt_workflow_step_initialization_error";
22 | })(ErrorCode = exports.ErrorCode || (exports.ErrorCode = {}));
23 | class UnknownError extends Error {
24 | constructor(original) {
25 | super(original.message);
^
error: JSGlobalProxy is not a constructor
code: "slack_bolt_unknown_error"
at new UnknownError (/home/kierank/Documents/Projects/the-old-man/node_modules/@slack/bolt/dist/errors.js:25:9)
at asCodedError (/home/kierank/Documents/Projects/the-old-man/node_modules/@slack/bolt/dist/errors.js:35:12)
at handleError (/home/kierank/Documents/Projects/the-old-man/node_modules/@slack/bolt/dist/App.js:612:35)
[ERROR] An unhandled error occurred while Bolt processed an event
[ERROR] bolt-app 20 | ErrorCode["UnknownError"] = "slack_bolt_unknown_error";
21 | ErrorCode["WorkflowStepInitializationError"] = "slack_bolt_workflow_step_initialization_error";
22 | })(ErrorCode = exports.ErrorCode || (exports.ErrorCode = {}));
23 | class UnknownError extends Error {
24 | constructor(original) {
25 | super(original.message);
^
error: JSGlobalProxy is not a constructor
code: "slack_bolt_unknown_error"
at new UnknownError (/home/kierank/Documents/Projects/the-old-man/node_modules/@slack/bolt/dist/errors.js:25:9)
at asCodedError (/home/kierank/Documents/Projects/the-old-man/node_modules/@slack/bolt/dist/errors.js:35:12)
at handleError (/home/kierank/Documents/Projects/the-old-man/node_modules/@slack/bolt/dist/App.js:612:35)
[ERROR] An unhandled error occurred while Bolt processed an event
from bolt-js.
While developing slack-edge, I found that Socket Mode with Bun's built-in WebSocket implementation doesn't work. Thus, there is no workaround for it.
I am not sure about the JSGlobalProxy
error with Request URL settings. Nonetheless, @slack/bolt
is specifically designed only for Node.js usage. Therefore, it's not surprising to see such unexpected errors with Bun. If you're thinking of building a production-grade app, I don't recommend using @slack/bolt
with Bun. Instead, consider going with either @slack/bolt
+ Node.js or slack-edge
+ Node.js/Bun/Deno + Request URL.
from bolt-js.
Related Issues (20)
- How to get search params in custom routes HOT 4
- appToken is not read in socketMode @3.18.0 HOT 4
- Links with ampersand do not work in Slack iOS app HOT 6
- Add flag to `AwsLambdaReceiver` to disable Signature Verification HOT 1
- Events Subscription is continuously being turned off when we kill the process HOT 4
- Add reply_in_thread method HOT 1
- Run multiple replicas in k8s of bot app HOT 2
- Frequent disconnects in socket mode HOT 9
- Unable to upload a file in a direct message using files.completeUploadExternal HOT 7
- `too_many_websockets` causes Cannot read properties of undefined (reading 'event') HOT 5
- Keep getting Error: Cannot write headers after they are sent to the client HOT 3
- How do I create a custom ConsoleLogger? HOT 1
- Better typing for block actions payload HOT 3
- How to access Company ID during OAuth for Slack App Installation HOT 2
- Add docs/sample for using browser cookies to pass custom app data during OAuth flow
- chat.postMessage returns channel name in the response HOT 4
- How do i update "messages_tab_read_only_enabled" to true/false programmatically HOT 4
- Update Ruby version for documentation generation (2.7.6 is end-of-life) HOT 2
- Select menu of external data source - Max number - Problem HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bolt-js.