Skip to content

chore: add more documentation for configuring source maps properly #6119

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

Merged
merged 4 commits into from
Mar 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions docs/app/guides/debugging.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,27 @@ inline source maps, you will not see code frames.
By default, Cypress will include an inline source map in your spec file, so you
will get the most out of the error experience. If you
[modify the preprocessor](/api/node-events/preprocessors-api), ensure that inline
source maps are enabled to get the same experience. With webpack and the
[webpack preprocessor](https://github.com/cypress-io/cypress/tree/develop/npm/webpack-preprocessor),
for example, set
[the `devtool` option](https://webpack.js.org/configuration/devtool/) to
`inline-source-map`.
source maps are enabled to get the same experience. Some examples of this include:

- With webpack and the
[webpack preprocessor](https://github.com/cypress-io/cypress/tree/develop/npm/webpack-preprocessor), set
[the `devtool` option](https://webpack.js.org/configuration/devtool/) to
`inline-source-map`.
- With esbuild and the
[esbuild preprocessor](https://github.com/bahmutov/cypress-esbuild-preprocessor/tree/main), set
[the `sourcemap` option](https://esbuild.github.io/api/#sourcemap) to `inline` when
[creating the bundler](https://github.com/bahmutov/cypress-esbuild-preprocessor#esbuild-options).
- With cucumber and the
[cucumber preprocessor](https://github.com/badeball/cypress-cucumber-preprocessor/tree/master)
third party bundlers are used to bundle the code.
- For esbuild and the
[esbuild preprocessor](https://github.com/bahmutov/cypress-esbuild-preprocessor/tree/main),
set [the `sourcemap` option](https://esbuild.github.io/api/#sourcemap) to `inline` when
[creating the bundler](https://github.com/bahmutov/cypress-esbuild-preprocessor#esbuild-options).
Note: the cucumber preprocessor documentation for the esbuild bundler describes an experimental
option: `prettySourceMaps`, but this option is buggy and setting source maps on the esbuild
bundler directly works better.
- The other bundlers all default their source maps appropriately.

## Debugging flake

Expand Down