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

Line numbers in source map incorrect #780

Open
rgpublic opened this issue Jul 30, 2024 · 0 comments
Open

Line numbers in source map incorrect #780

rgpublic opened this issue Jul 30, 2024 · 0 comments

Comments

@rgpublic
Copy link

The line number sometimes are a bit off. I tried to get to the bottom of this and reduce as much styles as possible. See attached ZIP. I'm using the NodeJS API and basically this code (excerpt):

let { code, map } = transform({
  filename: 'style.css',
  code: Buffer.from(codeBuffer),
  inputSourceMap: Buffer.from(mapBuffer),
  minify: true,
  sourceMap: true
});

code+="\n\/\*# sourceMappingURL="+path.basename(outfile)+".map */\n";

If included the input code (index_unminified.css) and input source map (index_unminified.css.map) in the ZIP. Now for this selector: ".paragraph-stage .body .field-body h1.text-align-center strong" the line number shown in the browser's developer console is 63. Correct would be 76. If I remove anyform_errors.scss, it works. So the problem must be caused by the styles in this file. I couldn't narrow it down further unfortunately. Hope it helps.

sass.zip

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

No branches or pull requests

1 participant