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

extname expansion does not include json #225

Closed
kumavis opened this issue Jun 24, 2020 · 4 comments
Closed

extname expansion does not include json #225

kumavis opened this issue Jun 24, 2020 · 4 comments

Comments

@kumavis
Copy link

kumavis commented Jun 24, 2020

resolve.sync('./config', { basedir: '/home/xyz/Development/lavamoat/packages/survey/downloads/fixpack/' })
/*
Uncaught:
Error: Cannot find module './config' from '/home/xyz/Development/lavamoat/packages/survey/downloads/fixpack/'
    at Function.resolveSync [as sync] (/home/xyz/Development/lavamoat/node_modules/resolve/lib/sync.js:89:15) {
  code: 'MODULE_NOT_FOUND'
}
*/
require.resolve('./config')
//=> '/home/xyz/Development/lavamoat/packages/survey/downloads/fixpack/config.json'
@kumavis kumavis changed the title extname expansion does not handle json extname expansion does not include json Jun 24, 2020
@kumavis
Copy link
Author

kumavis commented Jun 24, 2020

resolve v1.17.0 on node v12.16.1

@kumavis
Copy link
Author

kumavis commented Jun 24, 2020

as a workaround I'll just use the node builtin resolver

const { resolve } = require("module").createRequire(process.cwd());
resolve("./config")

@ljharb
Copy link
Member

ljharb commented Jun 24, 2020

This is intentional; you can provide it in the extensions option. See #137 as well.

@ljharb
Copy link
Member

ljharb commented Dec 1, 2020

Closing in favor of #166.

@ljharb ljharb closed this as completed Dec 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants