liferay / electric

⚡ Create beautiful documentation for your projects
https://electricjs.com
Other
118 stars 26 forks source link

Error when trying to require file #151

Open protoEvangelion opened 6 years ago

protoEvangelion commented 6 years ago

When running electric run it throws an error for every page around the metal:render:html step.

My environment:

Here is the error stack trace that appears to be coming from lib/pipelines/bundle.js:

[14:15:48] Error when trying to require the "/home/ryan/dev/notes/.temp/task/metal/site/pages/docs/Security/index.js" file
[14:15:48] Details: Unexpected identifier
/home/ryan/dev/notes/node_modules/webpack/lib/webpack.js:19
                throw new WebpackOptionsValidationError(webpackOptionsValidationErrors);
                ^

WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.entry should be one of these:
   object { <key>: non-empty string | [non-empty string] } | non-empty string | [non-empty string] | function
   -> The entry point(s) of the compilation.
   Details:
    * configuration.entry should not be empty.
      -> Multiple entry bundles are created. The key is the chunk name. The value can be a string or an array.
    * configuration.entry should be a string.
      -> An entry point without name. The string is resolved to a module which is loaded upon startup.
    * configuration.entry should be an array:
      [non-empty string]
    * configuration.entry should be an instance of function
      -> A Function returning an entry object, an entry string, an entry array or a promise to these things.
    at webpack (/home/ryan/dev/notes/node_modules/webpack/lib/webpack.js:19:9)
    at DestroyableTransform._flush (/home/ryan/dev/notes/node_modules/electric/lib/pipelines/bundle.js:56:4)
    at DestroyableTransform.prefinish (/home/ryan/dev/notes/node_modules/readable-stream/lib/_stream_transform.js:138:10)
    at emitNone (events.js:106:13)
    at DestroyableTransform.emit (events.js:208:7)
    at prefinish (/home/ryan/dev/notes/node_modules/readable-stream/lib/_stream_writable.js:619:14)
    at finishMaybe (/home/ryan/dev/notes/node_modules/readable-stream/lib/_stream_writable.js:627:5)
    at endWritable (/home/ryan/dev/notes/node_modules/readable-stream/lib/_stream_writable.js:638:3)
    at DestroyableTransform.Writable.end (/home/ryan/dev/notes/node_modules/readable-stream/lib/_stream_writable.js:594:41)
    at DestroyableTransform.onend (/home/ryan/dev/notes/node_modules/gulp/node_modules/readable-stream/lib/_stream_readable.js:523:10)
protoEvangelion commented 6 years ago

Just found out this doesn't happen on electric-cli v2.2.0

Might have something to do with electric-cli upgrading webpack to v3.