Skip to content
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

Better compatibility with source-map-support #1120

Open
gajus opened this issue Nov 20, 2020 · 6 comments
Open

Better compatibility with source-map-support #1120

gajus opened this issue Nov 20, 2020 · 6 comments
Labels
auto-triage-skip needs info An issue that is claimed to be a bug and hasn't been reproduced, or otherwise needs more info pkg:web-api applies to `@slack/web-api`

Comments

@gajus
Copy link

gajus commented Nov 20, 2020

Description

At the moment NPM packages do not include ./src.

ls -lah node_modules/@slack/web-api
total 48
drwxr-xr-x   5 gajus  staff    160 Oct 24 19:50 ./
drwxr-xr-x   5 gajus  staff    160 Oct 24 19:50 ../
-rw-r--r--   1 gajus  staff  17209 Oct 26  1985 README.md
drwxr-xr-x  34 gajus  staff   1088 Oct 24 19:50 dist/
-rw-r--r--   1 gajus  staff   3100 Oct 24 19:50 package.json

This is a problem, because if I get a stack trace such as the one below:

Error: A rate-limit has been reached, you may retry this request in 1 seconds
    at Object.rateLimitedErrorWithDelay (/Users/gajus/Documents/dev/[..]/node_modules/@slack/web-api/src/errors.ts:107:5)
    at /Users/gajus/Documents/dev/[..]/node_modules/@slack/web-api/src/WebClient.ts:323:36
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:93:5)
    at run (/Users/gajus/Documents/dev/[..]/node_modules/p-queue/dist/index.js:163:29) {
  code: 'slack_webapi_rate_limited_error',
  retryAfter: 1
}

Then I cannot just click-through to the code to see what is causing the underlying issue.

@gitwave gitwave bot added the untriaged label Nov 20, 2020
@aoberoi
Copy link
Contributor

aoberoi commented Nov 20, 2020

That's interesting. I would have thought the stack frames would reference files in dist/, which you should be able to click into. That may not be actually what you'd like, if you'd rather see the TypeScript input instead of the build output, but at least it would work. I'll try to reproduce this.

Are you interested in seeing the TypeScript source? If so, we'd need to make sure sourcemapping is wired up correctly and we'd need to ship the src directory in the distribution. This would be a tradeoff with bundle size. Are there any best practices for allowing smaller bundles as well as allowing folks to opt-in to the debugging with the source?

@aoberoi
Copy link
Contributor

aoberoi commented Nov 21, 2020

I wasn't able to reproduce this problem. My stack trace is showing files in dist, and in the VSCode terminal, I can "click through" to the source file in dist.

Kapture 2020-11-20 at 17 09 35

Is there any other build tool processing your source code that might have contributed to this problem? Any info you can give us about your environment (node version, editor, etc)?

@aoberoi aoberoi added question M-T: User needs support to use the project needs info An issue that is claimed to be a bug and hasn't been reproduced, or otherwise needs more info and removed untriaged labels Nov 21, 2020
@gajus
Copy link
Author

gajus commented Nov 22, 2020

The reason my stack trace includes ./src is because babel-node uses https://www.npmjs.com/package/source-map-support. This automatically resolves stack trace to point to the original source codes.

@seratch seratch added discussion M-T: An issue where more input is needed to reach a decision good first issue and removed needs info An issue that is claimed to be a bug and hasn't been reproduced, or otherwise needs more info labels May 6, 2021
@seratch seratch changed the title Include ./src in npm packages Better compatibility with source-map-support May 6, 2021
@seratch
Copy link
Member

seratch commented May 6, 2021

I've updated the labels for this task. Although our team is not actively working on this, contributions are always welcome (as long as it does not bring any breaking changes).

@seratch seratch removed the question M-T: User needs support to use the project label Aug 31, 2021
@github-actions
Copy link

github-actions bot commented Dec 5, 2021

👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out.

@filmaj filmaj added needs info An issue that is claimed to be a bug and hasn't been reproduced, or otherwise needs more info pkg:web-api applies to `@slack/web-api` and removed good first issue discussion M-T: An issue where more input is needed to reach a decision labels Jan 26, 2024
@sergio-toro
Copy link

It's a shame that a company like Slack does not invest time in properly shipping SDK's...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-triage-skip needs info An issue that is claimed to be a bug and hasn't been reproduced, or otherwise needs more info pkg:web-api applies to `@slack/web-api`
Projects
None yet
Development

No branches or pull requests

5 participants