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

Node.js 18.8.0 changed return type of module.findSourceMap() #44391

Closed
danez opened this issue Aug 25, 2022 · 2 comments · Fixed by #44397
Closed

Node.js 18.8.0 changed return type of module.findSourceMap() #44391

danez opened this issue Aug 25, 2022 · 2 comments · Fixed by #44397

Comments

@danez
Copy link

danez commented Aug 25, 2022

Version

18.8.0

Platform

not relevant

Subsystem

module

What steps will reproduce the bug?

assert(require('node:module').findSourceMap('') === undefined)

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior?

Return undefined

What do you see instead?

Return null

Additional information

avajs/ava#3092

https://github.com/nodejs/node/pull/43875/files#r954804828

@legendecas
Copy link
Member

Thank you for reporting this! I'll submit a regression for this.

@sindresorhus
Copy link

I also noticed that the return value in the docs does not show that it can be undefined (or null).

nodejs-github-bot pushed a commit that referenced this issue Aug 27, 2022
Return `undefined` when no source map is found for the given filename on
`findSourceMap`.

PR-URL: #44397
Fixes: #44391
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
RafaelGSS pushed a commit that referenced this issue Sep 5, 2022
Return `undefined` when no source map is found for the given filename on
`findSourceMap`.

PR-URL: #44397
Fixes: #44391
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Fyko pushed a commit to Fyko/node that referenced this issue Sep 15, 2022
Return `undefined` when no source map is found for the given filename on
`findSourceMap`.

PR-URL: nodejs#44397
Fixes: nodejs#44391
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
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 a pull request may close this issue.

3 participants