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

fix: append inline sourcemap to executed modules #342

Closed
wants to merge 1 commit into from

Conversation

aleclarson
Copy link
Contributor

@aleclarson aleclarson commented Dec 27, 2021

This allows the step debugger to find/open the original file and trigger breakpoints properly.

This allows the debugger to find/open the original file and trigger breakpoints properly.
@netlify
Copy link

netlify bot commented Dec 27, 2021

✔️ Deploy Preview for vitest-dev ready!

🔨 Explore the source changes: f50755e

🔍 Inspect the deploy log: https://app.netlify.com/sites/vitest-dev/deploys/61ca4856c8ffb8000841548a

😎 Browse the preview: https://deploy-preview-342--vitest-dev.netlify.app

@antfu
Copy link
Member

antfu commented Dec 28, 2021

Well, actually we had that, but I removed it as I thought it was not necessary. Can you check if bringing them back would fix your issue? (I would like to avoid introducing deps as possible)

@Smrtnyk
Copy link

Smrtnyk commented Dec 28, 2021

Would be cool if someone could also check if this fixes issues with breakpoints also in intellij

@aleclarson
Copy link
Contributor Author

Well, actually we had that, but I removed it as I thought it was not necessary. Can you check if bringing them back would fix your issue? (I would like to avoid introducing deps as possible)

I mentioned you on Discord about it: https://discord.com/channels/917386801235247114/925124758331355186/925163821725794334

But yeah, I've confirmed it fixes both breakpoints and code frames

@aleclarson
Copy link
Contributor Author

If someone else wants to handle removing the convert-source-map dependency, it would be appreciated.

Here's the code being used:

Converter.prototype.toBase64 = function () {
  var json = this.toJSON();
  return (SafeBuffer.Buffer.from(json, 'utf8') || "").toString('base64');
};

Converter.prototype.toComment = function (options) {
  var base64 = this.toBase64();
  var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
  return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data;
};

@Monkatraz Monkatraz mentioned this pull request Dec 28, 2021
@antfu
Copy link
Member

antfu commented Dec 29, 2021

@antfu antfu closed this in 274203b Dec 29, 2021
JakeGinnivan pushed a commit to JakeGinnivan/vitest that referenced this pull request Jan 8, 2022
chaii3 pushed a commit to chaii3/vitest that referenced this pull request May 13, 2022
…dev#342)

* feat(useAxios): axios instance support

* described issue with checking if an object is an axios instance
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