GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — module: fix resolution of filename with trailing slash by targos · Pull Request #6215 · nodejs/node

Conversation

@targos

@targos targos commented Apr 15, 2016 •
edited by Fishrock123
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
Checklist
  • tests and code linting passes
  • a test and/or benchmark is included
  • documentation is changed or added
  • the commit message follows commit guidelines
Affected core subsystem(s)

module

Description of change

A recent optimization of module loading performance [1] forgot to check that
extensions were set in a certain code path.

[1] ae18bbe

Fixes: #6214

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

fusepilot reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@targos targos added the module Issues and PRs related to the module subsystem. label Apr 15, 2016
@targos

targos commented Apr 15, 2016

Copy link
Copy Markdown
Member Author

I added a test in a separate commit but I'm not sure it's very useful. If the fixtures are removed by accident, the test would still pass.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Apr 15, 2016

Copy link
Copy Markdown
Member

LGTM

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell jasnell mentioned this pull request Apr 15, 2016
v6.0.0 Release Candidate 4 #6155
Closed
@Salakar

Salakar commented Apr 15, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Does this resolve issues with require('../') ? Looks like it does

See Salakar/mocha@7c07b67

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Salakar referenced this pull request in Salakar/mocha Apr 15, 2016
@Salakar
Change mocha require path
7c07b67
Currently in node 6 (RC2) the `require('../')` breaks with the below error:

```
module.js:128
  for (var i = 0; i < exts.length; i++) {
                          ^

TypeError: Cannot read property 'length' of undefined
    at tryExtensions (module.js:128:27)
    at tryPackage (module.js:107:10)
    at Function.Module._findPath (module.js:182:18)
    at Function.Module._resolveFilename (module.js:434:25)
    at Function.Module._load (module.js:384:25)
    at Module.require (module.js:464:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/Users/XXXX/Documents/Personal/Projects/XXXXX/node_modules/mocha/bin/_mocha:12:11)
    at Module._compile (module.js:539:32)
    at Object.Module._extensions..js (module.js:548:10)
```

Changing to `require('./../lib/mocha')` resolves the issue.
@mscdex

mscdex commented Apr 15, 2016

Copy link
Copy Markdown
Contributor

LGTM if CI is ok: https://ci.nodejs.org/job/node-test-pull-request/2275/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@targos targos added this to the 6.0.0 milestone Apr 16, 2016
@Trott

Trott commented Apr 16, 2016

Copy link
Copy Markdown
Member

I added a test in a separate commit but I'm not sure it's very useful. If the fixtures are removed by accident, the test would still pass.

If you want to guard against that, perhaps you can either:

  • check for the fixture file's existence as part of the test
  • use the tmp dir instead of fixtures and create the file as part of the test
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Apr 18, 2016

Copy link
Copy Markdown
Member

Is this ready to land?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@MylesBorins

MylesBorins commented Apr 18, 2016

Copy link
Copy Markdown
Contributor

citgm: https://ci.nodejs.org/job/thealphanerd-smoker/200/

(running because this touches module)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@targos
module: fix resolution of filename with trailing slash
1f6816b
A recent optimization of module loading performance [1] forgot to check that
extensions were set in a certain code path.

[1] nodejs@ae18bbe

Fixes: nodejs#6214
@targos
targos force-pushed the fix-6214 branch from ad17970 to 1f6816b Compare April 19, 2016 07:20
@targos

targos commented Apr 19, 2016

Copy link
Copy Markdown
Member Author

I consolidated the test.
CI: https://ci.nodejs.org/job/node-test-commit/2968/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Apr 20, 2016

Copy link
Copy Markdown
Member

CI is green but there are a couple of CITGM failures. It's not clear if they're related but I doubt it. The failure here looks like it's related to the recent realpath changes.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@MylesBorins

MylesBorins commented Apr 20, 2016

Copy link
Copy Markdown
Contributor

There has been a flury of activity on master. I'm running citgm on the head of master to see if these breakages are related to something else

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Apr 20, 2016

Copy link
Copy Markdown
Member

New CI: https://ci.nodejs.org/job/node-test-pull-request/2343/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@MylesBorins

MylesBorins commented Apr 20, 2016

Copy link
Copy Markdown
Contributor

So funny enough... without out this fix master is even more broken.... lol

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Apr 20, 2016

Copy link
Copy Markdown
Member

Indeed. if the new CI comes up green I'll be getting this landed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell jasnell added the dont-land-on-v4.x label Apr 20, 2016
jasnell pushed a commit that referenced this pull request Apr 20, 2016
@targos @jasnell
module: fix resolution of filename with trailing slash
75487f0
A recent optimization of module loading performance [1] forgot to check that
extensions were set in a certain code path.

[1] ae18bbe

Fixes: #6214
PR-URL: #6215
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Brian White <[email protected]>
@jasnell

jasnell commented Apr 20, 2016

Copy link
Copy Markdown
Member

Landed in 75487f0

Salakar reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell jasnell closed this Apr 20, 2016
@jasnell jasnell added the dont-land-on-v5.x label Apr 20, 2016
@targos
targos deleted the fix-6214 branch April 20, 2016 17:40
joelostrowski pushed a commit to joelostrowski/node that referenced this pull request Apr 25, 2016
@targos @joelostrowski
module: fix resolution of filename with trailing slash
aeb613f
A recent optimization of module loading performance [1] forgot to check that
extensions were set in a certain code path.

[1] nodejs@ae18bbe

Fixes: nodejs#6214
PR-URL: nodejs#6215
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Brian White <[email protected]>
jasnell pushed a commit that referenced this pull request Apr 26, 2016
@targos @jasnell
module: fix resolution of filename with trailing slash
f3d9de7
A recent optimization of module loading performance [1] forgot to check that
extensions were set in a certain code path.

[1] ae18bbe

Fixes: #6214
PR-URL: #6215
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Brian White <[email protected]>
@DrDexter6000 DrDexter6000 mentioned this pull request Apr 6, 2026
Windows: ConoutConnection worker thread prevents Node.js from exiting after kill() microsoft/node-pty#887
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

module Issues and PRs related to the module subsystem.

Projects

None yet

Milestone

6.0.0

Development

Successfully merging this pull request may close these issues.

module resolution can fail with trailing slash

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@targos @jasnell @Salakar @mscdex @Trott @MylesBorins
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.