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

feat: add sourceMaps option #3232

Closed
wants to merge 1 commit into from

Conversation

aleclarson
Copy link

When this option is false, the --enable-source-maps Node.js flag is not set for worker threads.

When this option is false, the --enable-source-maps Node.js flag is not set for worker threads.
@aleclarson
Copy link
Author

aleclarson commented Aug 13, 2023

Okay, the execArgv no longer contains --enable-source-maps, but I'm still seeing translated stacks. 😳

Possibly related to --loader=tsx 🤔

@sindresorhus
Copy link
Member

What problem does it solve?

@aleclarson
Copy link
Author

Tried using ts-node instead, but the suggested setup seems out of date? Couldn't get it working, even after removing the configurableModuleFormat experiment option.

{
  "ava": {
    "extensions": {
      "ts": "module"
    },
    "nonSemVerExperiments": {
      "configurableModuleFormat": true
    },
    "nodeArguments": [
      "--loader=ts-node/esm"
    ]
  }
}

@aleclarson
Copy link
Author

aleclarson commented Aug 13, 2023

What problem does it solve?

I'm writing a compiler, so I need to see the output code to get a clearer view of what's going wrong at runtime.

edit: The current bug I'm facing is actually related to JSX compiling (not my compiler) into something that fails at runtime. But it's related to my library, which provides a JSX runtime.

@aleclarson
Copy link
Author

Okay, the execArgv no longer contains --enable-source-maps, but I'm still seeing translated stacks. 😳

Possibly related to --loader=tsx 🤔

This is indeed related to the "tsx" loader.

https://github.com/esbuild-kit/core-utils/blob/develop/src/source-map.ts

@novemberborn
Copy link
Member

I agree there should be a way to not use the built-in source map support. However I don't think it should be a CLI flag, it should go into the config. I'm wary of booleans since the behavior change is quite subtle. Perhaps sourceMaps: 'built-in' | 'manual'.

@novemberborn
Copy link
Member

Please re-open if you have a chance to return to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants