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

Webpack 5.0.0-beta.22 logs gigantic object to console on error #1726

Closed
ctjlewis opened this issue Aug 1, 2020 · 4 comments
Closed

Webpack 5.0.0-beta.22 logs gigantic object to console on error #1726

ctjlewis opened this issue Aug 1, 2020 · 4 comments

Comments

@ctjlewis
Copy link

ctjlewis commented Aug 1, 2020

Bug report

Title pretty much says it all. Upgraded from webpack 4 to 5.0.0-beta.22 and the build now fails and dumps a huge object to stdout with no additional context. I intend to workaround this, but the logic behind this logging behavior should likely be patched.

What is the current behavior?

The following message is dumped to console, process exits with error code 1:

Expand error
          maxInitialSize: {
            description: 'Maximal size hint for the initial chunks.',
            oneOf: [Array]
          },
          maxSize: {
            description: 'Maximal size hint for the created chunks.',
            oneOf: [Array]
          },
          minChunks: {
            description: "Minimum number of times a module has to be duplicated until it's considered for splitting.",
            type: 'number',
            minimum: 1
          },
          minRemainingSize: {
            description: 'Minimal size for the chunks the stay after moving the modules to a new chunk.',
            oneOf: [Array]
          },
          minSize: {
            description: 'Minimal size for the created chunk.',
            oneOf: [Array]
          },
          name: {
            description: 'Give chunks for this cache group a name (chunks with equal name are merged).',
            anyOf: [Array]
          },
          priority: {
            description: 'Priority of this cache group.',
            type: 'number'
          },
          reuseExistingChunk: {
            description: 'Try to reuse existing chunk (with name) when it has matching modules.',
            type: 'boolean'
          },
          test: {
            description: 'Assign modules to a cache group by module name.',
            anyOf: [Array]
          },
          type: {
            description: 'Assign modules to a cache group by module type.',
            anyOf: [Array]
          }
        }
      },
      OptimizationSplitChunksGetCacheGroups: {
        description: 'A function returning cache groups.',
        instanceof: 'Function',
        tsType: "((module: import('../lib/Module')) => OptimizationSplitChunksCacheGroup | OptimizationSplitChunksCacheGroup[] | void)"
      },
      OptimizationSplitChunksOptions: {
        description: 'Options object for splitting chunks into smaller chunks.',
        type: 'object',
        additionalProperties: false,
        properties: {
          automaticNameDelimiter: {
            description: 'Sets the name delimiter for created chunks.',
            type: 'string',
            minLength: 1
          },
          cacheGroups: {
            description: "Assign modules to a cache group (modules from different cache groups are tried to keep in separate chunks, default categories: 'default', 'defaultVendors').",
            type: 'object',
            additionalProperties: [Object],
            not: [Object]
          },
          chunks: {
            description: 'Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).',
            anyOf: [Array]
          },
          fallbackCacheGroup: {
            description: 'Options for modules not selected by any other cache group.',
            type: 'object',
            additionalProperties: false,
            properties: [Object]
          },
          filename: {
            description: 'Sets the template for the filename for created chunks.',
            anyOf: [Array]
          },
          hidePathInfo: {
            description: 'Prevents exposing path info when creating names for parts splitted by maxSize.',
            type: 'boolean'
          },
          maxAsyncRequests: {
            description: 'Maximum number of requests which are accepted for on-demand loading.',
            type: 'number',
            minimum: 1
          },
          maxAsyncSize: {
            description: 'Maximal size hint for the on-demand chunks.',
            oneOf: [Array]
          },
          maxInitialRequests: {
            description: 'Maximum number of initial chunks which are accepted for an entry point.',
            type: 'number',
            minimum: 1
          },
          maxInitialSize: {
            description: 'Maximal size hint for the initial chunks.',
            oneOf: [Array]
          },
          maxSize: {
            description: 'Maximal size hint for the created chunks.',
            oneOf: [Array]
          },
          minChunks: {
            description: "Minimum number of times a module has to be duplicated until it's considered for splitting.",
            type: 'number',
            minimum: 1
          },
          minRemainingSize: {
            description: 'Minimal size for the chunks the stay after moving the modules to a new chunk.',
            oneOf: [Array]
          },
          minSize: {
            description: 'Minimal size for the created chunks.',
            oneOf: [Array]
          },
          name: {
            description: 'Give chunks created a name (chunks with equal name are merged).',
            anyOf: [Array]
          }
        }
      },
      OptimizationSplitChunksSizes: {
        description: 'Size description for limits.',
        anyOf: [
          {
            description: 'Size of the javascript part of the chunk.',
            type: 'number',
            minimum: 0
          },
          {
            description: 'Specify size limits per size type.',
            type: 'object',
            additionalProperties: [Object]
          }
        ]
      },
      Output: {
        description: 'Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.',
        type: 'object',
        additionalProperties: false,
        properties: {
          assetModuleFilename: { '$ref': '#/definitions/AssetModuleFilename' },
          auxiliaryComment: { cli: [Object], oneOf: [Array] },
          chunkCallbackName: { '$ref': '#/definitions/ChunkCallbackName' },
          chunkFilename: { '$ref': '#/definitions/ChunkFilename' },
          chunkLoadTimeout: { '$ref': '#/definitions/ChunkLoadTimeout' },
          compareBeforeEmit: { '$ref': '#/definitions/CompareBeforeEmit' },
          crossOriginLoading: { '$ref': '#/definitions/CrossOriginLoading' },
          devtoolFallbackModuleFilenameTemplate: {
            '$ref': '#/definitions/DevtoolFallbackModuleFilenameTemplate'
          },
          devtoolModuleFilenameTemplate: { '$ref': '#/definitions/DevtoolModuleFilenameTemplate' },
          devtoolNamespace: { '$ref': '#/definitions/DevtoolNamespace' },
          ecmaVersion: { '$ref': '#/definitions/EcmaVersion' },
          enabledLibraryTypes: { '$ref': '#/definitions/EnabledLibraryTypes' },
          filename: { '$ref': '#/definitions/Filename' },
          globalObject: { '$ref': '#/definitions/GlobalObject' },
          hashDigest: { '$ref': '#/definitions/HashDigest' },
          hashDigestLength: { '$ref': '#/definitions/HashDigestLength' },
          hashFunction: { '$ref': '#/definitions/HashFunction' },
          hashSalt: { '$ref': '#/definitions/HashSalt' },
          hotUpdateChunkFilename: { '$ref': '#/definitions/HotUpdateChunkFilename' },
          hotUpdateFunction: { '$ref': '#/definitions/HotUpdateFunction' },
          hotUpdateMainFilename: { '$ref': '#/definitions/HotUpdateMainFilename' },
          iife: { '$ref': '#/definitions/Iife' },
          importFunctionName: { '$ref': '#/definitions/ImportFunctionName' },
          jsonpFunction: { '$ref': '#/definitions/JsonpFunction' },
          library: { '$ref': '#/definitions/Library' },
          libraryExport: { cli: [Object], oneOf: [Array] },
          libraryTarget: { cli: [Object], oneOf: [Array] },
          module: { '$ref': '#/definitions/OutputModule' },
          path: { '$ref': '#/definitions/Path' },
          pathinfo: { '$ref': '#/definitions/Pathinfo' },
          publicPath: { '$ref': '#/definitions/PublicPath' },
          scriptType: { '$ref': '#/definitions/ScriptType' },
          sourceMapFilename: { '$ref': '#/definitions/SourceMapFilename' },
          sourcePrefix: { '$ref': '#/definitions/SourcePrefix' },
          strictModuleExceptionHandling: { '$ref': '#/definitions/StrictModuleExceptionHandling' },
          umdNamedDefine: { cli: [Object], oneOf: [Array] },
          uniqueName: { '$ref': '#/definitions/UniqueName' },
          webassemblyModuleFilename: { '$ref': '#/definitions/WebassemblyModuleFilename' }
        }
      },
      OutputModule: {
        description: 'Output javascript files as module source type.',
        type: 'boolean'
      },
      OutputNormalized: {
        description: 'Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.',
        type: 'object',
        additionalProperties: false,
        properties: {
          assetModuleFilename: { '$ref': '#/definitions/AssetModuleFilename' },
          chunkCallbackName: { '$ref': '#/definitions/ChunkCallbackName' },
          chunkFilename: { '$ref': '#/definitions/ChunkFilename' },
          chunkLoadTimeout: { '$ref': '#/definitions/ChunkLoadTimeout' },
          compareBeforeEmit: { '$ref': '#/definitions/CompareBeforeEmit' },
          crossOriginLoading: { '$ref': '#/definitions/CrossOriginLoading' },
          devtoolFallbackModuleFilenameTemplate: {
            '$ref': '#/definitions/DevtoolFallbackModuleFilenameTemplate'
          },
          devtoolModuleFilenameTemplate: { '$ref': '#/definitions/DevtoolModuleFilenameTemplate' },
          devtoolNamespace: { '$ref': '#/definitions/DevtoolNamespace' },
          ecmaVersion: { '$ref': '#/definitions/EcmaVersion' },
          enabledLibraryTypes: { '$ref': '#/definitions/EnabledLibraryTypes' },
          filename: { '$ref': '#/definitions/Filename' },
          globalObject: { '$ref': '#/definitions/GlobalObject' },
          hashDigest: { '$ref': '#/definitions/HashDigest' },
          hashDigestLength: { '$ref': '#/definitions/HashDigestLength' },
          hashFunction: { '$ref': '#/definitions/HashFunction' },
          hashSalt: { '$ref': '#/definitions/HashSalt' },
          hotUpdateChunkFilename: { '$ref': '#/definitions/HotUpdateChunkFilename' },
          hotUpdateFunction: { '$ref': '#/definitions/HotUpdateFunction' },
          hotUpdateMainFilename: { '$ref': '#/definitions/HotUpdateMainFilename' },
          iife: { '$ref': '#/definitions/Iife' },
          importFunctionName: { '$ref': '#/definitions/ImportFunctionName' },
          jsonpFunction: { '$ref': '#/definitions/JsonpFunction' },
          library: { '$ref': '#/definitions/LibraryOptions' },
          module: { '$ref': '#/definitions/OutputModule' },
          path: { '$ref': '#/definitions/Path' },
          pathinfo: { '$ref': '#/definitions/Pathinfo' },
          publicPath: { '$ref': '#/definitions/PublicPath' },
          scriptType: { '$ref': '#/definitions/ScriptType' },
          sourceMapFilename: { '$ref': '#/definitions/SourceMapFilename' },
          sourcePrefix: { '$ref': '#/definitions/SourcePrefix' },
          strictModuleExceptionHandling: { '$ref': '#/definitions/StrictModuleExceptionHandling' },
          uniqueName: { '$ref': '#/definitions/UniqueName' },
          webassemblyModuleFilename: { '$ref': '#/definitions/WebassemblyModuleFilename' }
        }
      },
      Parallelism: {
        description: 'The number of parallel processed modules in the compilation.',
        type: 'number',
        minimum: 1
      },
      Path: {
        description: 'The output directory as **absolute path** (required).',
        type: 'string',
        absolutePath: true
      },
      Pathinfo: {
        description: 'Include comments with information about the modules.',
        type: 'boolean'
      },
      Performance: {
        description: 'Configuration for web performance recommendations.',
        anyOf: [
          { enum: [Array] },
          { '$ref': '#/definitions/PerformanceOptions' }
        ]
      },
      PerformanceOptions: {
        description: 'Configuration object for web performance recommendations.',
        type: 'object',
        additionalProperties: false,
        properties: {
          assetFilter: {
            description: 'Filter function to select assets that are checked.',
            instanceof: 'Function',
            tsType: 'Function'
          },
          hints: {
            description: 'Sets the format of the hints: warnings, errors or nothing at all.',
            enum: [Array]
          },
          maxAssetSize: {
            description: 'File size limit (in bytes) when exceeded, that webpack will provide performance hints.',
            type: 'number'
          },
          maxEntrypointSize: {
            description: 'Total size of an entry point (in bytes).',
            type: 'number'
          }
        }
      },
      Plugins: {
        description: 'Add additional plugins to the compiler.',
        type: 'array',
        items: {
          description: 'Plugin of type object or instanceof Function.',
          anyOf: [ [Object], [Object] ]
        }
      },
      Profile: {
        description: 'Capture timing information for each module.',
        type: 'boolean'
      },
      PublicPath: {
        description: 'The `publicPath` specifies the public URL address of the output files when referenced in a browser.',
        anyOf: [
          { type: 'string' },
          {
            instanceof: 'Function',
            tsType: '((pathData: import("../lib/Compilation").PathData, assetInfo?: import("../lib/Compilation").AssetInfo) => string)'
          }
        ]
      },
      RecordsInputPath: {
        description: 'Store compiler state to a json file.',
        anyOf: [ { enum: [Array] }, { type: 'string', absolutePath: true } ]
      },
      RecordsOutputPath: {
        description: 'Load compiler state from a json file.',
        anyOf: [ { enum: [Array] }, { type: 'string', absolutePath: true } ]
      },
      RecordsPath: {
        description: 'Store/Load compiler state from/to a json file. This will result in persistent ids of modules and chunks. An absolute path is expected. `recordsPath` is used for `recordsInputPath` and `recordsOutputPath` if they left undefined.',
        anyOf: [ { enum: [Array] }, { type: 'string', absolutePath: true } ]
      },
      Resolve: {
        description: 'Options for the resolver.',
        oneOf: [ { '$ref': '#/definitions/ResolveOptions' } ]
      },
      ResolveLoader: {
        description: 'Options for the resolver when resolving loaders.',
        oneOf: [ { '$ref': '#/definitions/ResolveOptions' } ]
      },
      ResolveOptions: {
        description: 'Options object for resolving requests.',
        type: 'object',
        additionalProperties: false,
        properties: {
          alias: { description: 'Redirect module requests.', anyOf: [Array] },
          aliasFields: {
            description: 'Fields in the description file (usually package.json) which are used to redirect requests inside the module.',
            type: 'array',
            items: [Object]
          },
          byDependency: {
            description: 'Extra resolve options per dependency category. Typical categories are "commonjs", "amd", "esm".',
            type: 'object',
            additionalProperties: [Object]
          },
          cache: {
            description: 'Enable caching of successfully resolved requests (cache entries are revalidated).',
            type: 'boolean'
          },
          cachePredicate: {
            description: 'Predicate function to decide which requests should be cached.',
            instanceof: 'Function',
            tsType: "((request: import('enhanced-resolve').ResolveRequest) => boolean)"
          },
          cacheWithContext: {
            description: 'Include the context information in the cache identifier when caching.',
            type: 'boolean'
          },
          conditionNames: {
            description: 'Condition names for exports field entry point.',
            type: 'array',
            items: [Object]
          },
          descriptionFiles: {
            description: 'Filenames used to find a description file (like a package.json).',
            type: 'array',
            items: [Object]
          },
          enforceExtension: {
            description: 'Enforce using one of the extensions from the extensions option.',
            type: 'boolean'
          },
          exportsFields: {
            description: 'Field names from the description file (usually package.json) which are used to provide entry points of a package.',
            type: 'array',
            items: [Object]
          },
          extensions: {
            description: 'Extensions added to the request when trying to find the file.',
            type: 'array',
            items: [Object]
          },
          fileSystem: {
            description: 'Filesystem for the resolver.',
            tsType: "(import('../lib/util/fs').InputFileSystem)"
          },
          mainFields: {
            description: 'Field names from the description file (package.json) which are used to find the default entry point.',
            type: 'array',
            items: [Object]
          },
          mainFiles: {
            description: 'Filenames used to find the default entry point if there is no description file or main field.',
            type: 'array',
            items: [Object]
          },
          modules: {
            description: 'Folder names or directory paths where to find modules.',
            type: 'array',
            items: [Object]
          },
          plugins: {
            description: 'Plugins for the resolver.',
            type: 'array',
            items: [Object]
          },
          resolver: {
            description: 'Custom resolver.',
            tsType: "(import('enhanced-resolve').Resolver)"
          },
          restrictions: {
            description: 'A list of resolve restrictions. Resolve results must fulfill all of these restrictions to resolve successfully. Other resolve paths are taken when restrictions are not met.',
            type: 'array',
            items: [Object]
          },
          roots: {
            description: "A list of directories in which requests that are server-relative URLs (starting with '/') are resolved. On non-windows system these requests are tried to resolve as absolute path first.",
            type: 'array',
            items: [Object]
          },
          symlinks: {
            description: 'Enable resolving symlinks to the original location.',
            type: 'boolean'
          },
          unsafeCache: {
            description: 'Enable caching of successfully resolved requests (cache entries are not revalidated).',
            anyOf: [Array]
          },
          useSyncFileSystemCalls: {
            description: 'Use synchronous filesystem calls for the resolver.',
            type: 'boolean'
          }
        }
      },
      ResolvePluginInstance: {
        description: 'Plugin instance.',
        type: 'object',
        additionalProperties: true,
        properties: {
          apply: {
            description: 'The run point of the plugin, required method.',
            instanceof: 'Function',
            tsType: "(resolver: import('enhanced-resolve/lib/Resolver')) => void"
          }
        },
        required: [ 'apply' ]
      },
      RuleSetCondition: {
        description: 'A condition matcher.',
        cli: { helper: true },
        anyOf: [
          { instanceof: 'RegExp', tsType: 'RegExp' },
          { type: 'string', minLength: 1 },
          {
            type: 'object',
            additionalProperties: false,
            properties: [Object]
          },
          {
            instanceof: 'Function',
            tsType: '((value: string) => boolean)'
          },
          { '$ref': '#/definitions/RuleSetConditions' }
        ]
      },
      RuleSetConditionAbsolute: {
        description: 'A condition matcher matching an absolute path.',
        cli: { helper: true },
        anyOf: [
          { instanceof: 'RegExp', tsType: 'RegExp' },
          { type: 'string', absolutePath: true },
          {
            type: 'object',
            additionalProperties: false,
            properties: [Object]
          },
          {
            instanceof: 'Function',
            tsType: '((value: string) => boolean)'
          },
          { '$ref': '#/definitions/RuleSetConditionsAbsolute' }
        ]
      },
      RuleSetConditionOrConditions: {
        description: 'One or multiple rule conditions.',
        cli: { helper: true },
        anyOf: [
          { '$ref': '#/definitions/RuleSetCondition' },
          { '$ref': '#/definitions/RuleSetConditions' }
        ]
      },
      RuleSetConditionOrConditionsAbsolute: {
        description: 'One or multiple rule conditions matching an absolute path.',
        cli: { helper: true },
        anyOf: [
          { '$ref': '#/definitions/RuleSetConditionAbsolute' },
          { '$ref': '#/definitions/RuleSetConditionsAbsolute' }
        ]
      },
      RuleSetConditions: {
        description: 'A list of rule conditions.',
        type: 'array',
        items: { description: 'A rule condition.', oneOf: [ [Object] ] }
      },
      RuleSetConditionsAbsolute: {
        description: 'A list of rule conditions matching an absolute path.',
        type: 'array',
        items: {
          description: 'A rule condition matching an absolute path.',
          oneOf: [ [Object] ]
        }
      },
      RuleSetLoader: {
        description: 'A loader request.',
        type: 'string',
        minLength: 1
      },
      RuleSetLoaderOptions: {
        description: 'Options passed to a loader.',
        anyOf: [ { type: 'string' }, { type: 'object' } ]
      },
      RuleSetRule: {
        description: 'A rule description with conditions and effects for modules.',
        type: 'object',
        additionalProperties: false,
        properties: {
          compiler: {
            description: 'Match the child compiler name.',
            oneOf: [Array]
          },
          enforce: {
            description: 'Enforce this rule as pre or post step.',
            enum: [Array]
          },
          exclude: {
            description: 'Shortcut for resource.exclude.',
            oneOf: [Array]
          },
          generator: {
            description: 'The options for the module generator.',
            type: 'object'
          },
          include: {
            description: 'Shortcut for resource.include.',
            oneOf: [Array]
          },
          issuer: {
            description: 'Match the issuer of the module (The module pointing to this module).',
            oneOf: [Array]
          },
          loader: { description: 'Shortcut for use.loader.', oneOf: [Array] },
          mimetype: {
            description: 'Match module mimetype when load from Data URI.',
            oneOf: [Array]
          },
          oneOf: {
            description: 'Only execute the first matching rule in this array.',
            oneOf: [Array]
          },
          options: { description: 'Shortcut for use.options.', oneOf: [Array] },
          parser: {
            description: 'Options for parsing.',
            type: 'object',
            additionalProperties: true
          },
          realResource: {
            description: 'Match the real resource path of the module.',
            oneOf: [Array]
          },
          resolve: {
            description: 'Options for the resolver.',
            type: 'object',
            oneOf: [Array]
          },
          resource: {
            description: 'Match the resource path of the module.',
            oneOf: [Array]
          },
          resourceFragment: {
            description: 'Match the resource fragment of the module.',
            oneOf: [Array]
          },
          resourceQuery: {
            description: 'Match the resource query of the module.',
            oneOf: [Array]
          },
          rules: {
            description: 'Match and execute these rules when this rule is matched.',
            oneOf: [Array]
          },
          sideEffects: {
            description: 'Flags a module as with or without side effects.',
            type: 'boolean'
          },
          test: {
            description: 'Shortcut for resource.test.',
            oneOf: [Array]
          },
          type: {
            description: 'Module type to use for the module.',
            type: 'string'
          },
          use: {
            description: 'Modifiers applied to the module when rule is matched.',
            oneOf: [Array]
          }
        }
      },
      RuleSetRules: {
        description: 'A list of rules.',
        type: 'array',
        items: { description: 'A rule.', oneOf: [ [Object] ] }
      },
      RuleSetUse: {
        description: 'A list of descriptions of loaders applied.',
        anyOf: [
          { type: 'array', items: [Object] },
          {
            instanceof: 'Function',
            tsType: '((data: { resource: string, realResource: string, resourceQuery: string, issuer: string, compiler: string }) => RuleSetUseItem[])'
          },
          { '$ref': '#/definitions/RuleSetUseItem' }
        ]
      },
      RuleSetUseItem: {
        description: 'A description of an applied loader.',
        anyOf: [
          {
            type: 'object',
            additionalProperties: false,
            properties: [Object]
          },
          {
            instanceof: 'Function',
            tsType: '((data: object) => RuleSetUseItem|RuleSetUseItem[])'
          },
          { '$ref': '#/definitions/RuleSetLoader' }
        ]
      },
      ScriptType: {
        description: 'This option enables loading async chunks via a custom script type, such as script type="module".',
        enum: [ false, 'text/javascript', 'module' ]
      },
      SourceMapFilename: {
        description: 'The filename of the SourceMaps for the JavaScript files. They are inside the `output.path` directory.',
        type: 'string',
        absolutePath: false
      },
      SourcePrefix: {
        description: 'Prefixes every line of the source in the bundle with this string.',
        type: 'string'
      },
      StatsOptions: {
        description: 'Stats options object.',
        type: 'object',
        additionalProperties: false,
        properties: {
          all: {
            description: 'Fallback value for stats options when an option is not defined (has precedence over local webpack defaults).',
            type: 'boolean'
          },
          assets: { description: 'Add assets information.', type: 'boolean' },
          assetsSort: {
            description: 'Sort the assets by that field.',
            type: 'string'
          },
          builtAt: {
            description: 'Add built at time information.',
            type: 'boolean'
          },
          cached: {
            description: 'Add information about cached (not built) modules.',
            type: 'boolean'
          },
          cachedAssets: {
            description: 'Show cached assets (setting this to `false` only shows emitted files).',
            type: 'boolean'
          },
          children: { description: 'Add children information.', type: 'boolean' },
          chunkGroups: {
            description: 'Display all chunk groups with the corresponding bundles.',
            type: 'boolean'
          },
          chunkModules: {
            description: 'Add built modules information to chunk information.',
            type: 'boolean'
          },
          chunkOrigins: {
            description: 'Add the origins of chunks and chunk merging info.',
            type: 'boolean'
          },
          chunkRelations: {
            description: 'Add information about parent, children and sibling chunks to chunk information.',
            type: 'boolean'
          },
          chunkRootModules: {
            description: 'Add root modules information to chunk information.',
            type: 'boolean'
          },
          chunks: { description: 'Add chunk information.', type: 'boolean' },
          chunksSort: {
            description: 'Sort the chunks by that field.',
            type: 'string'
          },
          colors: {
            description: 'Enables/Disables colorful output.',
            anyOf: [Array]
          },
          context: {
            description: 'Context directory for request shortening.',
            type: 'string',
            absolutePath: true
          },
          depth: {
            description: 'Add module depth in module graph.',
            type: 'boolean'
          },
          entrypoints: {
            description: 'Display the entry points with the corresponding bundles.',
            type: 'boolean'
          },
          env: { description: 'Add --env information.', type: 'boolean' },
          errorDetails: {
            description: 'Add details to errors (like resolving log).',
            type: 'boolean'
          },
          errorStack: {
            description: 'Add internal stack trace to errors.',
            type: 'boolean'
          },
          errors: { description: 'Add errors.', type: 'boolean' },
          exclude: {
            description: 'Please use excludeModules instead.',
            cli: [Object],
            anyOf: [Array]
          },
          excludeAssets: {
            description: 'Suppress assets that match the specified filters. Filters can be Strings, RegExps or Functions.',
            oneOf: [Array]
          },
          excludeModules: {
            description: 'Suppress modules that match the specified filters. Filters can be Strings, RegExps, Booleans or Functions.',
            anyOf: [Array]
          },
          hash: {
            description: 'Add the hash of the compilation.',
            type: 'boolean'
          },
          ids: { description: 'Add ids.', type: 'boolean' },
          logging: { description: 'Add logging output.', anyOf: [Array] },
          loggingDebug: {
            description: 'Include debug logging of specified loggers (i. e. for plugins or loaders). Filters can be Strings, RegExps or Functions.',
            anyOf: [Array]
          },
          loggingTrace: {
            description: 'Add stack traces to logging output.',
            type: 'boolean'
          },
          maxModules: {
            description: 'Set the maximum number of modules to be shown.',
            type: 'number'
          },
          moduleAssets: {
            description: 'Add information about assets inside modules.',
            type: 'boolean'
          },
          moduleTrace: {
            description: 'Add dependencies and origin of warnings/errors.',
            type: 'boolean'
          },
          modules: {
            description: 'Add built modules information.',
            type: 'boolean'
          },
          modulesSort: {
            description: 'Sort the modules by that field.',
            type: 'string'
          },
          nestedModules: {
            description: 'Add information about modules nested in other modules (like with module concatenation).',
            type: 'boolean'
          },
          optimizationBailout: {
            description: 'Show reasons why optimization bailed out for modules.',
            type: 'boolean'
          },
          orphanModules: {
            description: 'Add information about orphan modules.',
            type: 'boolean'
          },
          outputPath: {
            description: 'Add output path information.',
            type: 'boolean'
          },
          performance: {
            description: 'Add performance hint flags.',
            type: 'boolean'
          },
          preset: {
            description: 'Preset for the default values.',
            anyOf: [Array]
          },
          providedExports: {
            description: 'Show exports provided by modules.',
            type: 'boolean'
          },
          publicPath: {
            description: 'Add public path information.',
            type: 'boolean'
          },
          reasons: {
            description: 'Add information about the reasons why modules are included.',
            type: 'boolean'
          },
          runtime: {
            description: 'Add information about runtime modules.',
            type: 'boolean'
          },
          source: {
            description: 'Add the source code of modules.',
            type: 'boolean'
          },
          timings: { description: 'Add timing information.', type: 'boolean' },
          usedExports: {
            description: 'Show exports used by modules.',
            type: 'boolean'
          },
          version: {
            description: 'Add webpack version information.',
            type: 'boolean'
          },
          warnings: { description: 'Add warnings.', type: 'boolean' },
          warningsFilter: {
            description: 'Suppress warnings that match the specified filters. Filters can be Strings, RegExps or Functions.',
            oneOf: [Array]
          }
        }
      },
      StatsValue: {
        description: 'Stats options object or preset name.',
        anyOf: [
          { enum: [Array] },
          { type: 'boolean' },
          { '$ref': '#/definitions/StatsOptions' }
        ]
      },
      StrictModuleExceptionHandling: {
        description: 'Handles exceptions in module loading correctly at a performance cost.',
        type: 'boolean'
      },
      Target: {
        description: 'Environment to build for.',
        anyOf: [
          { enum: [Array] },
          {
            instanceof: 'Function',
            tsType: "((compiler: import('../lib/Compiler')) => void)"
          }
        ]
      },
      UmdNamedDefine: {
        description: 'If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.',
        type: 'boolean'
      },
      UniqueName: {
        description: 'A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.',
        type: 'string',
        minLength: 1
      },
      Watch: {
        description: 'Enter watch mode, which rebuilds on file change.',
        type: 'boolean'
      },
      WatchOptions: {
        description: 'Options for the watcher.',
        type: 'object',
        additionalProperties: false,
        properties: {
          aggregateTimeout: {
            description: 'Delay the rebuilt after the first change. Value is a time in ms.',
            type: 'number'
          },
          ignored: {
            description: 'Ignore some files from watching (glob pattern).',
            anyOf: [Array]
          },
          poll: {
            description: 'Enable polling mode for watching.',
            anyOf: [Array]
          },
          stdin: {
            description: 'Stop watching when stdin stream has ended.',
            type: 'boolean'
          }
        }
      },
      WebassemblyModuleFilename: {
        description: 'The filename of WebAssembly modules as relative path inside the `output.path` directory.',
        type: 'string',
        absolutePath: false
      },
      WebpackOptionsNormalized: {
        description: 'Normalized webpack options object.',
        type: 'object',
        additionalProperties: false,
        properties: {
          amd: { '$ref': '#/definitions/Amd' },
          bail: { '$ref': '#/definitions/Bail' },
          cache: { '$ref': '#/definitions/CacheOptionsNormalized' },
          context: { '$ref': '#/definitions/Context' },
          dependencies: { '$ref': '#/definitions/Dependencies' },
          devServer: { '$ref': '#/definitions/DevServer' },
          devtool: { '$ref': '#/definitions/DevTool' },
          entry: { '$ref': '#/definitions/EntryNormalized' },
          experiments: { '$ref': '#/definitions/Experiments' },
          externals: { '$ref': '#/definitions/Externals' },
          externalsType: { '$ref': '#/definitions/ExternalsType' },
          infrastructureLogging: { '$ref': '#/definitions/InfrastructureLogging' },
          loader: { '$ref': '#/definitions/Loader' },
          mode: { '$ref': '#/definitions/Mode' },
          module: { '$ref': '#/definitions/ModuleOptions' },
          name: { '$ref': '#/definitions/Name' },
          node: { '$ref': '#/definitions/Node' },
          optimization: { '$ref': '#/definitions/Optimization' },
          output: { '$ref': '#/definitions/OutputNormalized' },
          parallelism: { '$ref': '#/definitions/Parallelism' },
          performance: { '$ref': '#/definitions/Performance' },
          plugins: { '$ref': '#/definitions/Plugins' },
          profile: { '$ref': '#/definitions/Profile' },
          recordsInputPath: { '$ref': '#/definitions/RecordsInputPath' },
          recordsOutputPath: { '$ref': '#/definitions/RecordsOutputPath' },
          resolve: { '$ref': '#/definitions/Resolve' },
          resolveLoader: { '$ref': '#/definitions/ResolveLoader' },
          stats: { '$ref': '#/definitions/StatsValue' },
          target: { '$ref': '#/definitions/Target' },
          watch: { '$ref': '#/definitions/Watch' },
          watchOptions: { '$ref': '#/definitions/WatchOptions' }
        },
        required: [
          'cache',
          'entry',
          'experiments',
          'externals',
          'infrastructureLogging',
          'module',
          'node',
          'optimization',
          'output',
          'plugins',
          'resolve',
          'resolveLoader',
          'stats',
          'watchOptions'
        ]
      },
      WebpackPluginFunction: {
        description: 'Function acting as plugin.',
        instanceof: 'Function',
        tsType: "(this: import('../lib/Compiler'), compiler: import('../lib/Compiler')) => void"
      },
      WebpackPluginInstance: {
        description: 'Plugin instance.',
        type: 'object',
        additionalProperties: true,
        properties: {
          apply: {
            description: 'The run point of the plugin, required method.',
            instanceof: 'Function',
            tsType: "(compiler: import('../lib/Compiler')) => void"
          }
        },
        required: [ 'apply' ]
      }
    },
    description: 'Options object as provided by the user.',
    type: 'object',
    additionalProperties: false,
    properties: {
      amd: { '$ref': '#/definitions/Amd' },
      bail: { '$ref': '#/definitions/Bail' },
      cache: { '$ref': '#/definitions/CacheOptions' },
      context: { '$ref': '#/definitions/Context' },
      dependencies: { '$ref': '#/definitions/Dependencies' },
      devServer: { '$ref': '#/definitions/DevServer' },
      devtool: { '$ref': '#/definitions/DevTool' },
      entry: { '$ref': '#/definitions/Entry' },
      experiments: { '$ref': '#/definitions/Experiments' },
      externals: { '$ref': '#/definitions/Externals' },
      externalsType: { '$ref': '#/definitions/ExternalsType' },
      infrastructureLogging: { '$ref': '#/definitions/InfrastructureLogging' },
      loader: { '$ref': '#/definitions/Loader' },
      mode: { '$ref': '#/definitions/Mode' },
      module: { '$ref': '#/definitions/ModuleOptions' },
      name: { '$ref': '#/definitions/Name' },
      node: { '$ref': '#/definitions/Node' },
      optimization: { '$ref': '#/definitions/Optimization' },
      output: { '$ref': '#/definitions/Output' },
      parallelism: { '$ref': '#/definitions/Parallelism' },
      performance: { '$ref': '#/definitions/Performance' },
      plugins: { '$ref': '#/definitions/Plugins' },
      profile: { '$ref': '#/definitions/Profile' },
      recordsInputPath: { '$ref': '#/definitions/RecordsInputPath' },
      recordsOutputPath: { '$ref': '#/definitions/RecordsOutputPath' },
      recordsPath: { '$ref': '#/definitions/RecordsPath' },
      resolve: { '$ref': '#/definitions/Resolve' },
      resolveLoader: { '$ref': '#/definitions/ResolveLoader' },
      stats: { '$ref': '#/definitions/StatsValue' },
      target: { '$ref': '#/definitions/Target' },
      watch: { '$ref': '#/definitions/Watch' },
      watchOptions: { '$ref': '#/definitions/WatchOptions' }
    }
  },
  headerName: 'Webpack',
  baseDataPath: 'configuration',
  postFormatter: [Function: postFormatter]
}

If the current behavior is a bug, please provide the steps to reproduce.

Run webpack --config. I'm just bundling some ES modules here, nothing crazy.

What is the expected behavior?
A module should build, or I would even settle for a crumb of context in the form of a useful error message.

Other relevant information:
webpack version: 5.0.0-beta.22
Node.js version: v14.5.0
Operating System: Ubuntu 20.04

@ctjlewis
Copy link
Author

ctjlewis commented Aug 1, 2020

I was able to redirect stdout with yarn run webpack --config webpack.config.cjs &> output.txt and see the error at the top of the file. It looks like the size of the error message was due to how many were generated while rolling up Node dependencies:

- configuration[0].output.library should be an non-empty string.
 - configuration[1].output.library should be an non-empty string.
 - configuration[2].output.library should be an non-empty string.
    at validate (/home/christian/Projects/gdev/node_modules/schema-utils/dist/validate.js:96:11)
    at validateSchema (/home/christian/Projects/gdev/node_modules/webpack/lib/validateSchema.js:38:2)
    at webpack (/home/christian/Projects/gdev/node_modules/webpack/lib/webpack.js:100:2)
    at f (/home/christian/Projects/gdev/node_modules/webpack/lib/index.js:31:15)
    at processOptions (/home/christian/Projects/gdev/node_modules/webpack-cli/bin/cli.js:272:16)
    at /home/christian/Projects/gdev/node_modules/webpack-cli/bin/cli.js:364:3
    at Object.parse (/home/christian/Projects/gdev/node_modules/yargs/yargs.js:576:18)
    at /home/christian/Projects/gdev/node_modules/webpack-cli/bin/cli.js:49:8
    at Object.<anonymous> (/home/christian/Projects/gdev/node_modules/webpack-cli/bin/cli.js:366:3)
    at Module._compile (internal/modules/cjs/loader.js:1201:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1221:10)
    at Module.load (internal/modules/cjs/loader.js:1050:32)
    at Function.Module._load (internal/modules/cjs/loader.js:938:14)
    at Module.require (internal/modules/cjs/loader.js:1090:19)
    at require (internal/modules/cjs/helpers.js:75:18)
    at Object.<anonymous> (/home/christian/Projects/gdev/node_modules/webpack/bin/webpack.js:132:2)
    at Module._compile (internal/modules/cjs/loader.js:1201:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1221:10)
    at Module.load (internal/modules/cjs/loader.js:1050:32)
    at Function.Module._load (internal/modules/cjs/loader.js:938:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  errors: [
...

Closing this, error messages were just cut off by the long output.

@ctjlewis ctjlewis closed this as completed Aug 1, 2020
@sokra
Copy link
Member

sokra commented Aug 2, 2020

That's and webpack-cli 3 version in-compatiblity with webpack 5. I think the webpack-cli beta has this fixed.

But I think it would be still great to fix it in the stable version.

@sokra sokra reopened this Aug 2, 2020
@sokra sokra transferred this issue from webpack/webpack Aug 2, 2020
@ctjlewis
Copy link
Author

ctjlewis commented Aug 2, 2020

OK, thank you Tobias. I got around this but I appreciate your diligence, let me know if you need any additional info to repro.

@ctjlewis ctjlewis changed the title Webpack --config logs gigantic object to console, zero context Webpack 5.0.0-beta.22 logs gigantic object to console on error Aug 2, 2020
@alexander-akait
Copy link
Member

Fixed

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

3 participants