question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TS: Cannot find module '@slack/bolt'

See original GitHub issue

I have no idea why when I have clearly run yarn, this doesn’t resolve still

Screen Shot 2021-04-18 at 10 02 06 PM
import { App } from '@slack/bolt';

require('dotenv/config');

export const app = new App({
	endpoints: {
		events: '/slack/events',
		actions: '/slack/actions',
	},
	token: process.env.SLACK_BOT_TOKEN,
	signingSecret: process.env.SLACK_SIGNING_SECRET,
	clientId: process.env.SLACK_CLIENT_ID,
	clientSecret: process.env.SLACK_CLIENT_SECRET,
	stateSecret: 'my-state-secret',
	scopes: [
		'app_mentions:read',
		'chat:write',
		'chat:write.public',
		'chat:write.customize',
		'channels:read',
		'channels:manage',
		'channels:join',
		'groups:write',
		'im:write',
		'users:read',
		'groups:read',
		'incoming-webhook',
		'im:history',
		'commands',
	],
});

My package.json:

  "dependencies": {
    "@slack/bolt": "^2.1.1",
    "@slack/events-api": "^2.3.2",
    "@slack/web-api": "^5.10.0",
    "@slack/types": "^1.10.0",
...

If I’ve run yarn this should not be an issue. Yet TS complains it still is.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
seratchcommented, Apr 19, 2021

@dschinkel As the type for the field is string | string[], it should work for sure: https://github.com/slackapi/bolt-js/blob/%40slack/bolt%403.3.0/src/receivers/HTTPReceiver.ts#L21 Probably the error you’re facing may be due to another cause.

1reaction
seratchcommented, Apr 19, 2021

@dschinkel Great to know you’ve figured the cause out.

that this syntax is no longer valid?:

It’s not valid for the default receiver HTTPReceiver since v3. It works with a string or an array of string. The ExpressReceiver still accepts the object but actually the keys in the objet are not used at all.

Read more comments on GitHub >

github_iconTop Results From Across the Web

@slack/bolt - npm
A framework for building Slack apps, fast.. Latest version: 3.12.2, last published: 2 months ago. Start using @slack/bolt in your project by ...
Read more >
TS cannot find modules - typescript - Stack Overflow
I have ran the generator with the following environment: typescript, react, webpack w/ NPM, gulp. When I run gulp serve I get the...
Read more >
Getting started with Bolt for JavaScript
This guide is meant to walk you through getting up and running with a Slack app using Bolt for JavaScript. Along the way,...
Read more >
Build a Slackbot in Node.js with Slack's Bolt API
Build a Slackbot in Node.js with Slack's Bolt API ... To get started, we'll need a workspace to install our bot in. A...
Read more >
Top 5 @slack/bolt Code Examples - Snyk
To help you get started, we've selected a few @slack/bolt examples, ... Not working // Should error because message_action doesn't have type action_id ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found