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

if partialSearchPaths is an empty array, resolvePartialName errors #4

Open
elyseholladay opened this issue Nov 22, 2016 · 1 comment

Comments

@elyseholladay
Copy link
Collaborator

if partialSearchPaths is an empty array, resolvePartialName catches an error it should allow.

@lzilioli
Copy link

I'm encountering the following error when trying to run path resolution with an empty partialSearchPaths array.

The array is _.map-ed to promises, and passed to Promise.any. The error being thrown is by bluebird because it does not like an empty array being passed to Promise.any. In the event that the user explicitly passes an empty partialSearchPaths array, this code should be smart enough to not pass an empty array to Promise.any, and instead rely solely on the ingredient path resolution logic.

    at SomePromiseArray._getRangeError (/Users/lzilioli/Projects/bechamel/node_modules/bluebird/js/release/some.js:121:12)
    at SomePromiseArray._resolveEmptyArray (/Users/lzilioli/Projects/bechamel/node_modules/bluebird/js/release/some.js:125:23)
    at SomePromiseArray.init (/Users/lzilioli/Projects/bechamel/node_modules/bluebird/js/release/promise_array.js:70:18)
    at SomePromiseArray._init (/Users/lzilioli/Projects/bechamel/node_modules/bluebird/js/release/some.js:27:10)
    at SomePromiseArray.init (/Users/lzilioli/Projects/bechamel/node_modules/bluebird/js/release/some.js:38:10)
    at any (/Users/lzilioli/Projects/bechamel/node_modules/bluebird/js/release/any.js:9:9)
    at Function.Promise.any (/Users/lzilioli/Projects/bechamel/node_modules/bluebird/js/release/any.js:14:12)
    at /Users/lzilioli/Projects/bechamel/node_modules/@retailmenot/roux-handlebars-tools/index.js:143:18
    at tryCatcher (/Users/lzilioli/Projects/bechamel/node_modules/bluebird/js/release/util.js:16:23)
    at Function.Promise.attempt.Promise.try (/Users/lzilioli/Projects/bechamel/node_modules/bluebird/js/release/method.js:39:29)
    at resolvePartialName (/Users/lzilioli/Projects/bechamel/node_modules/@retailmenot/roux-handlebars-tools/index.js:140:20)
    at Object.module.exports.resolvePartialName (/Users/lzilioli/Projects/bechamel/node_modules/@retailmenot/roux-handlebars-tools/index.js:283:10)
    at module.exports.Config.merge.handlebarsLoader.partialResolver (/Users/lzilioli/Projects/bechamel/webpack.config.js:26:6)
    at resolvePartialsIterator (/Users/lzilioli/Projects/bechamel/node_modules/handlebars-loader/index.js:279:9)
    at /Users/lzilioli/Projects/bechamel/node_modules/handlebars-loader/node_modules/async/lib/async.js:111:13
    at Array.forEach (native)
    at _each (/Users/lzilioli/Projects/bechamel/node_modules/handlebars-loader/node_modules/async/lib/async.js:32:24)
    at Object.async.each (/Users/lzilioli/Projects/bechamel/node_modules/handlebars-loader/node_modules/async/lib/async.js:110:9)
    at resolveItems (/Users/lzilioli/Projects/bechamel/node_modules/handlebars-loader/index.js:338:13)
    at resolvePartials (/Users/lzilioli/Projects/bechamel/node_modules/handlebars-loader/index.js:342:7)
    at /Users/lzilioli/Projects/bechamel/node_modules/handlebars-loader/node_modules/async/lib/async.js:119:25
    at /Users/lzilioli/Projects/bechamel/node_modules/handlebars-loader/node_modules/async/lib/async.js:24:16
    at /Users/lzilioli/Projects/bechamel/node_modules/handlebars-loader/index.js:245:9
    at next (/Users/lzilioli/Projects/bechamel/node_modules/handlebars-loader/index.js:211:20)
    at /Users/lzilioli/Projects/bechamel/node_modules/handlebars-loader/index.js:227:20
    at /Users/lzilioli/Projects/bechamel/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:24:19
    at onResolved (/Users/lzilioli/Projects/bechamel/node_modules/enhanced-resolve/lib/Resolver.js:38:18)
    at /Users/lzilioli/Projects/bechamel/node_modules/enhanced-resolve/lib/Resolver.js:127:10
    at /Users/lzilioli/Projects/bechamel/node_modules/enhanced-resolve/lib/Resolver.js:191:15
    at applyPluginsParallelBailResult.createInnerCallback.log (/Users/lzilioli/Projects/bechamel/node_modules/enhanced-resolve/lib/Resolver.js:110:4)```

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

2 participants