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

Enable sourcemaps in dev #457

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

curran
Copy link

@curran curran commented Oct 8, 2024

Closes #456

Before:

image

After:

image

@@ -8,7 +8,7 @@ const path = require('path')
const isDevelopment = process.env.NODE_ENV !== 'production'
module.exports = {
entry: './src/index.tsx',
devtool: 'source-map',
devtool: isDevelopment ? 'eval-source-map' : 'source-map',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 I remember having no issues with debugging Unovis from the dev app. Was the error in the console also leading to the obfuscated bundle?

Also the source-map option generally produces better results that 'eval-source-map' and is more computationally expensive to calculate. Do you know why the eval-source-map works here better here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change changes the error message from pointing to bundle.js to pointing to something from node_modules. That's arguably an improvement, but actually it's not that much better, since we still are not getting the line numbers for the original error. Happy not to merge this, maybe it's just a weird case I'm dealing with. Thanks for reviewing!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But overall, the source maps don't seem to be working.

For example, when I add this change:

image

I get this error:

image

The source maps don't seem to be doing their job. Instead of bundle.js it should resolve to the specific line number and source file, but it does not.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After changing it to eval-source-map, the line numbers DO resolve correctly.

image

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My setup:

  • Node v22.8.0
  • Mac

I wonder if this is not a problem for others?

@lee00678
Copy link
Collaborator

Hi @rokotyan @curran, what's the status of this? Do we want this merged in?

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.

Support Sourcemaps for Dev
3 participants