You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now if you have a String instead of an Array, it will yield this error on yarn publish:
Trace:
TypeError: onlyFiles.map is not a function
at /Users/jack/.yarn/lib/cli.js:42596:38
at Generator.next (<anonymous>)
at step (/Users/jack/.yarn/lib/cli.js:310:30)
at /Users/jack/.yarn/lib/cli.js:321:13
I suggest that we improve this error message to check the type, and if it is not an Array, then alert to the user that the files property in package.json is a ${typeof prop} as opposed to erring on .map not being a function as it currently does.
// `files` field
if (onlyFiles) {
+ if (!(onlyFiles instanceof Array)) throw new MessageError('"files" property in package.json must be an Array');
let lines = [
'*', // ignore all files except those that are explicitly included with a negation filter
];
lines = lines.concat(
onlyFiles.map((filename: string): string => `!${filename}`),
onlyFiles.map((filename: string): string => `!${path.join(filename, '**')}`),
);
const regexes = ignoreLinesToRegex(lines, './');
filters = filters.concat(regexes);
}
niftylettuce
added a commit
to ladjs/express-redirect-loop
that referenced
this issue
Aug 22, 2020
Right now if you have a String instead of an Array, it will yield this error on
yarn publish
:I suggest that we improve this error message to check the type, and if it is not an Array, then alert to the user that the
files
property inpackage.json
is a${typeof prop}
as opposed to erring on.map
not being a function as it currently does.Ref: #7815
The text was updated successfully, but these errors were encountered: