Uh oh!
There was an error while loading. Please reload this page.
doc fix: align code example for module.createRequireFromPath() with actual code behavior. - #26606
doc fix: align code example for module.createRequireFromPath() with actual code behavior.#26606creativecomposer wants to merge 1 commit into
Conversation
module.createRequireFromPath() takes a filename as argument. But the accompanying code example in the documentation makes it seem like it can take a directory argument as well. However, if a directory is passed as argument instead of a filename, then the function does not work as expected. Therefore, the fix is to make explicit in the code example that only filenames could be passed to module.createRequireFromPath() and not directory names. Fixes: #23710 Refs: #24763 (comment)
BridgeAR
commented
Mar 13, 2019
@Antony2025 thanks a lot for the PR! Since there is an open PR that pretty much does the same as your, I would rather get that over the finish line instead. I hope that is OK? |
creativecomposer
commented
Mar 14, 2019
@BridgeAR remember the other open PR assumes that the directory taking PR is already landed. Therefore, the other PR must be changed so that it reflects the current code behavior: module.createRequireFromPath() works fine only when a file name is passed. See @Trott comment there: #24763 (comment) |
creativecomposer
commented
Mar 18, 2019
Hi @BridgeAR and @guybedford , Quite frankly, I do not see any response from the other PR author for @Trott review comment, therefore I would much rather prefer my PR - which is as per @Trott comment - to be merged. Anyway, up to you guys to decide. |
creativecomposer
commented
Mar 20, 2019
Closing this PR, because there is another open PR to address the issue. |
module.createRequireFromPath() takes a filename as argument.
But the accompanying code example in the documentation makes it seem
like it can take a directory argument as well.
However, if a directory is passed as argument instead of a filename,
then the function does not work as expected.
Therefore, the fix is to make explicit in the code example that
only filenames could be passed to module.createRequireFromPath()
and not directory names.
Fixes: #23710
Refs: #24763 (comment)
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes