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

Error while capturing Stack trace - Missing mappings.wasm #6

Open
mayanagarwal opened this issue Dec 8, 2021 · 3 comments
Open

Error while capturing Stack trace - Missing mappings.wasm #6

mayanagarwal opened this issue Dec 8, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@mayanagarwal
Copy link

Current Behaviour

I am using slonik as a postgres-client to talk to my database. It is being used in 2 places -

  1. Inside a Graphql query which runs on serverless (lambda on aws).
  2. Directly fetching data from node cli scripts.

In the first scenario, I get an error message - ENOENT: no such file or directory, open '<PATH TO>/.esbuild/.build/src/handlers/mappings.wasm'. Which suggests that it is looking for that file in order to capture stack trace.

esbuild config in serverless -

  esbuild:
    loader:
      .graphql: text
      .html: text
    packager: npm
    bundle: true
    minify: true
    sourcemap: true
    keepNames: true
    concurrency: 8
    exclude:
      - pg-native

also the order for plugins in correct in serverless

In the second scenario, it works like a charm. I am able to talk to my db and also get the stack trace which is super helpful.

Possible Solution

Not sure about the possible solution but I can temporarily disable slonik to capture stack trace by setting captureStackTrace: false while creating pool.

Logs

Unable to produce a details log because captureStackTrace itself is throwing error.

@mayanagarwal mayanagarwal added the bug Something isn't working label Dec 8, 2021
@gajus gajus transferred this issue from gajus/slonik Mar 26, 2022
@gajus
Copy link
Owner

gajus commented Mar 26, 2022

@mayanagarwal This is an issue with the underlying library get-stack-trace.

Can you please add a failing test to this repository?

@kaisellgren
Copy link

kaisellgren commented Sep 14, 2023

@gajus is it fine to completely disable captureStackTrace? If it's enabled, it prevents us from enable source maps for NodeJS in production. We are now disabling it entirely, but was wondering if there're any drawbacks.

This can be reproduced with --enable-source-maps NodeJS flag (and using e.g. Webpack to generate source-map files with devtool: 'sourrce-map'.

@gajus
Copy link
Owner

gajus commented Sep 15, 2023

@gajus is it fine to completely disable captureStackTrace? If it's enabled, it prevents us from enable source maps for NodeJS in production. We are now disabling it entirely, but was wondering if there're any drawbacks.

None at all if you don't need them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants