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 >= v12.3.0 Cannot require module with relative path #30

Closed
deepal opened this issue Mar 15, 2020 · 0 comments · Fixed by #31
Closed

Node >= v12.3.0 Cannot require module with relative path #30

deepal opened this issue Mar 15, 2020 · 0 comments · Fixed by #31
Labels
bug Something isn't working critical bug
Milestone

Comments

@deepal
Copy link
Owner

deepal commented Mar 15, 2020

Resolving local modules with relative paths has broken in Node v12.3.0 probably due to nodejs/node#27598

$ ls src/baapan.js                                                                                                                  
src/baapan.js
$ /Users/deepal/.nvm/versions/node/v12.3.0/bin/node --require @babel/register src/entrypoint.js
Switching to workspace /Users/deepal/.baapan/workspace_47039_1584287356022
Workspace loaded!
> require('./src/baapan.js')
Thrown:
Error: Cannot find module './src/baapan.js'
Require stack:
- /Users/deepal/Projects/baapan/src/baapan.js
- /Users/deepal/Projects/baapan/src/index.js
- /Users/deepal/Projects/baapan/src/entrypoint.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:623:15)
    at Function.resolve (internal/modules/cjs/helpers.js:21:19)
    at Module._module.Module.require (/Users/deepal/Projects/baapan/src/baapan.js:130:19)
    at require (internal/modules/cjs/helpers.js:16:16) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/deepal/Projects/baapan/src/baapan.js',
    '/Users/deepal/Projects/baapan/src/index.js',
    '/Users/deepal/Projects/baapan/src/entrypoint.js'
  ]
}
> 

Requiring with absolute path works fine

> require('/Users/deepal/Projects/baapan/src/baapan.js')
{ default: [Function: BaapanREPLServer] }
> 

Change log for Node v12.3.0 https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V12.md#2019-05-21-version-1230-current-bridgear

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working critical bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant