dbelyaeff / cogear.js

Modern static websites generator (Node.JS/Webpack)

Home Page:https://cogearjs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't build anymore πŸ˜•

maikeldaloo opened this issue Β· comments

Hello,
I've been using cogear for the past few weeks, but as of recently, the build and watch stopped working. Would you be able to provide any help on this?

This is what I get when I run cogear -n and cogear build.

βœ” Current working dir: ~/Projects/MY_PROJECT
βœ” Theme default.
βœ” Preloaded in 311ms.
(node:19638) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type object
    at assertPath (path.js:39:11)
    at Object.join (path.js:1157:7)
    at Promise.all.files.map.file (/Users/maikel/.nvm/versions/node/v10.10.0/lib/node_modules/cogear/node_modules/hard-source-webpack-plugin/lib/envHash.js:42:54)
    at Array.map (<anonymous>:null:null)
    at hashFiles (/Users/maikel/.nvm/versions/node/v10.10.0/lib/node_modules/cogear/node_modules/hard-source-webpack-plugin/lib/envHash.js:42:28)
    at module.exports.options (/Users/maikel/.nvm/versions/node/v10.10.0/lib/node_modules/cogear/node_modules/hard-source-webpack-plugin/lib/envHash.js:84:20)
    at runReadOrReset (/Users/maikel/.nvm/versions/node/v10.10.0/lib/node_modules/cogear/node_modules/hard-source-webpack-plugin/index.js:286:9)
    at _next0 (<anonymous>:57:17)
    at _promise0.then._result0 (<anonymous>:75:1)

(node:19638) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
βœ” Resources are copied to the output folder.

I tried removing all the JS files, removed a whole bunch of files, reverted my git repo to a time where I had no issues, but I keep getting the same issue.

Any ideas? Suggestions?

Thanks in advance,
Maikel

I get no extra information when running cogear --verbose.

And I just tried latest version of Node, no luck.

I also tried a fresh project... got the following:

βœ” Current working dir: ~/Projects/test-site
βœ” Theme default.
βœ” Preloaded in 39ms.

βœ” success webpack compiled in 3s 723ms
webpack built 5a6a075a6cf034169b17 in 3728ms
βœ– Page index.md layout 'index.pug' doesn't exists: Error: Cannot find module 'index.pug'
Require stack:
- /Users/maikel/.nvm/versions/node/v12.4.0/lib/node_modules/cogear/lib/plugins/build.js
- /Users/maikel/.nvm/versions/node/v12.4.0/lib/node_modules/cogear/lib/cogear.js
- /Users/maikel/.nvm/versions/node/v12.4.0/lib/node_modules/cogear/bin/cogear.js

 Error: Internal EJS error: no file name or template provided

(node:30075) UnhandledPromiseRejectionWarning: Error: Cannot find module 'index.pug'
Require stack:
- /Users/maikel/.nvm/versions/node/v12.4.0/lib/node_modules/cogear/lib/plugins/build.js
- /Users/maikel/.nvm/versions/node/v12.4.0/lib/node_modules/cogear/lib/cogear.js
- /Users/maikel/.nvm/versions/node/v12.4.0/lib/node_modules/cogear/bin/cogear.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:623:15)
    at Function.resolve (internal/modules/cjs/helpers.js:21:19)
    at /Users/maikel/.nvm/versions/node/v12.4.0/lib/node_modules/cogear/lib/plugins/build.js:91:28
    at new Promise (<anonymous>:null:null)
    at Object.page (/Users/maikel/.nvm/versions/node/v12.4.0/lib/node_modules/cogear/lib/plugins/build.js:60:12)
    at /Users/maikel/.nvm/versions/node/v12.4.0/lib/node_modules/cogear/lib/plugins/build.js:22:31
    at /Users/maikel/.nvm/versions/node/v12.4.0/lib/node_modules/cogear/node_modules/emittery/index.js:69:13
    at Array.map (<anonymous>:null:null)
    at Cogear.emit (/Users/maikel/.nvm/versions/node/v12.4.0/lib/node_modules/cogear/node_modules/emittery/index.js:67:23)
    at processTicksAndRejections (internal/process/task_queues.js:89:5)
    at Object.<anonymous> (/Users/maikel/.nvm/versions/node/v12.4.0/lib/node_modules/cogear/lib/plugins/build.js:51:9)

(node:30075) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)

All this is on OSX Mojave. Latest node and npm.

Switched to Node v10.10.0 and that's working for me now.