Skip to content

Conversation

@varungandhi-src
Copy link
Contributor

We need to pass --enable-source-maps when launching node,
because Node will not use source maps (even if present) by default.

Additionally, let's avoid the divergence in settings across development
and production.

@varungandhi-src varungandhi-src merged commit ed2ad3b into scip Aug 4, 2025
2 checks passed
@varungandhi-src varungandhi-src deleted the vg/source-maps branch August 4, 2025 12:35
@efritz
Copy link

efritz commented Aug 7, 2025

@varungandhi-src This broke our integration:

$ yarn global add @sourcegraph/scip-python
$ NODE_OPTIONS="--max_old_space_size=8192" scip-python index

/usr/bin/env: ‘node --enable-source-maps’: No such file or directory
/usr/bin/env: use -[v]S to pass options in shebang lines

Shouldn't this be /usr/bin/env -S <...>? What's the intended way to invoke this?

@varungandhi-src
Copy link
Contributor Author

Hmm, I thought I tested that locally. Double-checking; will cut a new release with a fix.

varungandhi-src added a commit that referenced this pull request Aug 8, 2025
`env` on different systems behaves differently. On macOS,
`env ABC XYZ` will invoke ABC with argument XYZ.
On some Linux variants, you need `env -S ABC XYZ` for that.
On Alpine, the `-S` flag is not supported, and there is seemingly
no way of passing arguments.

So this patch undoes the accidental breakage in #179
and uses the `getSourceMapsSupport` API.

Technically, both `process.setSourceMapsEnabled` and
`module.setSourceMapsSupport` are experimental functions,
so to be safe, we do a dynamic existence check before calling
them for portability across Node versions.
@varungandhi-src
Copy link
Contributor Author

@efritz this should be fixed in the 0.6.2 release. I checked using Docker. Let me know if you're still hitting issues.

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.

3 participants