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

require.resolve w/ webpack seems couldn't resolve module #366

Open
ogonkov opened this issue Aug 29, 2018 · 0 comments
Open

require.resolve w/ webpack seems couldn't resolve module #366

ogonkov opened this issue Aug 29, 2018 · 0 comments

Comments

@ogonkov
Copy link

ogonkov commented Aug 29, 2018

While i try to resolve path to main of module, node fail to do so.

require.resolve('swipebox');

I believe it happens because of absolute path in main:

main: '/src/js/jquery.swipebox.js'
/Users/user/Projects/awesomeness/node_modules/webpack-cli/bin/cli.js:244
				throw err;
				^

Error: Cannot find module 'swipebox'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.require.resolve (/Users/user/Projects/awesomeness/node_modules/v8-compile-cache/v8-compile-cache.js:162:23)
    at module.exports (/Users/user/Projects/awesomeness/app/js/landing/config.js:68:39)
    at module.exports (/Users/user/Projects/awesomeness/app/js/landing/webpack.dev.js:10:9)
    at handleFunction (/Users/user/Projects/awesomeness/node_modules/webpack-cli/bin/prepareOptions.js:23:13)
    at prepareOptions (/Users/user/Projects/awesomeness/node_modules/webpack-cli/bin/prepareOptions.js:9:5)
    at requireConfig (/Users/user/Projects/awesomeness/node_modules/webpack-cli/bin/convert-argv.js:136:14)
    at /Users/user/Projects/awesomeness/node_modules/webpack-cli/bin/convert-argv.js:142:17
    at Array.forEach (<anonymous>)
    at module.exports (/Users/user/Projects/awesomeness/node_modules/webpack-cli/bin/convert-argv.js:140:15)
    at yargs.parse (/Users/user/Projects/awesomeness/node_modules/webpack-cli/bin/cli.js:241:39)
    at Object.parse (/Users/user/Projects/awesomeness/node_modules/webpack-cli/node_modules/yargs/yargs.js:563:18)
    at /Users/user/Projects/awesomeness/node_modules/webpack-cli/bin/cli.js:219:8
    at Object.<anonymous> (/Users/user/Projects/awesomeness/node_modules/webpack-cli/bin/cli.js:530:3)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/user/Projects/awesomeness/node_modules/webpack/bin/webpack.js:165:2)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:612:3

My env:
$ node -v
v8.11.3
$ npm -v
6.4.0

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

No branches or pull requests

1 participant