Planka on Windows error: A hook (userconfig) failed to load! #354

Closed
opened 2026-02-04 18:40:15 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @amakuhin on GitHub (Sep 9, 2023).

Hello,

After allmost all installation steps, on "npm run db:init" I got an error:

error: A hook (`userconfig`) failed to load!

It appears only in the first time I launch this command after install, in second time everything looks well... BTW database was created and filled with tables successfully.

But, on next step, "npm start --prod", I got more verbose error:

error: A hook (`userconfig`) failed to load!
error: Failed to lift app: Error: Attempted to `require('E:\planka\server\config\custom.js')`, but an error occurred:
--
TypeError: Cannot read properties of undefined (reading 'split')
    at Object.<anonymous> (E:\planka\server\config\custom.js:38:48)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:121:18)
    at E:\planka\server\node_modules\include-all\lib\help-include-all-sync.js:293:33
    at Array.forEach (<anonymous>)
    at _recursivelyIncludeAll (E:\planka\server\node_modules\include-all\lib\help-include-all-sync.js:178:11)
    at includeAll (E:\planka\server\node_modules\include-all\lib\help-include-all-sync.js:317:5)
    at helpBuildDictionary (E:\planka\server\node_modules\include-all\lib\help-build-dictionary.js:46:13)
    at module.exports.aggregate (E:\planka\server\node_modules\include-all\index.js:101:10)
    at loadOtherConfigFiles (E:\planka\server\node_modules\sails\lib\hooks\moduleloader\index.js:162:22)
    at runTask (E:\planka\server\node_modules\async\dist\async.js:1637:13)
    at E:\planka\server\node_modules\async\dist\async.js:1575:13
--
    at E:\planka\server\node_modules\include-all\lib\help-include-all-sync.js:298:25
    at Array.forEach (<anonymous>)
    at _recursivelyIncludeAll (E:\planka\server\node_modules\include-all\lib\help-include-all-sync.js:178:11)
    at includeAll (E:\planka\server\node_modules\include-all\lib\help-include-all-sync.js:317:5)
    at helpBuildDictionary (E:\planka\server\node_modules\include-all\lib\help-build-dictionary.js:46:13)
    at module.exports.aggregate (E:\planka\server\node_modules\include-all\index.js:101:10)
    at loadOtherConfigFiles (E:\planka\server\node_modules\sails\lib\hooks\moduleloader\index.js:162:22)
    at runTask (E:\planka\server\node_modules\async\dist\async.js:1637:13)
    at E:\planka\server\node_modules\async\dist\async.js:1575:13
    at processQueue (E:\planka\server\node_modules\async\dist\async.js:1585:13)
    at Object.auto (E:\planka\server\node_modules\async\dist\async.js:1571:5)
    at Hook.loadUserConfig (E:\planka\server\node_modules\sails\lib\hooks\moduleloader\index.js:160:13)
    at Hook.wrapper [as loadUserConfig] (E:\planka\server\node_modules\@sailshq\lodash\lib\index.js:3282:19)
    at Hook.loadModules (E:\planka\server\node_modules\sails\lib\hooks\userconfig\index.js:45:21)
    at Hook.wrapper [as loadModules] (E:\planka\server\node_modules\@sailshq\lodash\lib\index.js:3282:19)
    at modules (E:\planka\server\node_modules\sails\lib\hooks\index.js:86:25)
error: More details (raw): TypeError: Cannot read properties of undefined (reading 'split')
    at Object.<anonymous> (E:\planka\server\config\custom.js:38:48)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:121:18)
    at E:\planka\server\node_modules\include-all\lib\help-include-all-sync.js:293:33
    at Array.forEach (<anonymous>)
    at _recursivelyIncludeAll (E:\planka\server\node_modules\include-all\lib\help-include-all-sync.js:178:11)
    at includeAll (E:\planka\server\node_modules\include-all\lib\help-include-all-sync.js:317:5)
    at helpBuildDictionary (E:\planka\server\node_modules\include-all\lib\help-build-dictionary.js:46:13)
    at module.exports.aggregate (E:\planka\server\node_modules\include-all\index.js:101:10)
    at loadOtherConfigFiles (E:\planka\server\node_modules\sails\lib\hooks\moduleloader\index.js:162:22)
    at runTask (E:\planka\server\node_modules\async\dist\async.js:1637:13)
    at E:\planka\server\node_modules\async\dist\async.js:1575:13

I have a guess that something is wrong with Sails. But I didn't find any solution how to fix it.

I tried to repeat all steps on win11 and WinServer2012R2, but results are the same

npm and system info:

npm version
{
  npm: '10.0.0',
  node: '18.17.1',
  acorn: '8.8.2',
  ada: '2.5.0',
  ares: '1.19.1',
  brotli: '1.0.9',
  cldr: '43.0',
  icu: '73.1',
  llhttp: '6.0.11',
  modules: '108',
  napi: '9',
  nghttp2: '1.52.0',
  nghttp3: '0.7.0',
  ngtcp2: '0.8.1',
  openssl: '3.0.10+quic',
  simdutf: '3.2.12',
  tz: '2023c',
  undici: '5.22.1',
  unicode: '15.0',
  uv: '1.44.2',
  uvwasi: '0.0.18',
  v8: '10.2.154.26-node.26',
  zlib: '1.2.13.1-motley'
}

Please help me to overcome this problem

Originally created by @amakuhin on GitHub (Sep 9, 2023). Hello, After allmost all installation steps, on "npm run db:init" I got an error: ```powershell error: A hook (`userconfig`) failed to load! ``` It appears only in the first time I launch this command after install, in second time everything looks well... BTW database was created and filled with tables successfully. But, on next step, "npm start --prod", I got more verbose error: ```powershell error: A hook (`userconfig`) failed to load! error: Failed to lift app: Error: Attempted to `require('E:\planka\server\config\custom.js')`, but an error occurred: -- TypeError: Cannot read properties of undefined (reading 'split') at Object.<anonymous> (E:\planka\server\config\custom.js:38:48) at Module._compile (node:internal/modules/cjs/loader:1256:14) at Module._extensions..js (node:internal/modules/cjs/loader:1310:10) at Module.load (node:internal/modules/cjs/loader:1119:32) at Module._load (node:internal/modules/cjs/loader:960:12) at Module.require (node:internal/modules/cjs/loader:1143:19) at require (node:internal/modules/cjs/helpers:121:18) at E:\planka\server\node_modules\include-all\lib\help-include-all-sync.js:293:33 at Array.forEach (<anonymous>) at _recursivelyIncludeAll (E:\planka\server\node_modules\include-all\lib\help-include-all-sync.js:178:11) at includeAll (E:\planka\server\node_modules\include-all\lib\help-include-all-sync.js:317:5) at helpBuildDictionary (E:\planka\server\node_modules\include-all\lib\help-build-dictionary.js:46:13) at module.exports.aggregate (E:\planka\server\node_modules\include-all\index.js:101:10) at loadOtherConfigFiles (E:\planka\server\node_modules\sails\lib\hooks\moduleloader\index.js:162:22) at runTask (E:\planka\server\node_modules\async\dist\async.js:1637:13) at E:\planka\server\node_modules\async\dist\async.js:1575:13 -- at E:\planka\server\node_modules\include-all\lib\help-include-all-sync.js:298:25 at Array.forEach (<anonymous>) at _recursivelyIncludeAll (E:\planka\server\node_modules\include-all\lib\help-include-all-sync.js:178:11) at includeAll (E:\planka\server\node_modules\include-all\lib\help-include-all-sync.js:317:5) at helpBuildDictionary (E:\planka\server\node_modules\include-all\lib\help-build-dictionary.js:46:13) at module.exports.aggregate (E:\planka\server\node_modules\include-all\index.js:101:10) at loadOtherConfigFiles (E:\planka\server\node_modules\sails\lib\hooks\moduleloader\index.js:162:22) at runTask (E:\planka\server\node_modules\async\dist\async.js:1637:13) at E:\planka\server\node_modules\async\dist\async.js:1575:13 at processQueue (E:\planka\server\node_modules\async\dist\async.js:1585:13) at Object.auto (E:\planka\server\node_modules\async\dist\async.js:1571:5) at Hook.loadUserConfig (E:\planka\server\node_modules\sails\lib\hooks\moduleloader\index.js:160:13) at Hook.wrapper [as loadUserConfig] (E:\planka\server\node_modules\@sailshq\lodash\lib\index.js:3282:19) at Hook.loadModules (E:\planka\server\node_modules\sails\lib\hooks\userconfig\index.js:45:21) at Hook.wrapper [as loadModules] (E:\planka\server\node_modules\@sailshq\lodash\lib\index.js:3282:19) at modules (E:\planka\server\node_modules\sails\lib\hooks\index.js:86:25) error: More details (raw): TypeError: Cannot read properties of undefined (reading 'split') at Object.<anonymous> (E:\planka\server\config\custom.js:38:48) at Module._compile (node:internal/modules/cjs/loader:1256:14) at Module._extensions..js (node:internal/modules/cjs/loader:1310:10) at Module.load (node:internal/modules/cjs/loader:1119:32) at Module._load (node:internal/modules/cjs/loader:960:12) at Module.require (node:internal/modules/cjs/loader:1143:19) at require (node:internal/modules/cjs/helpers:121:18) at E:\planka\server\node_modules\include-all\lib\help-include-all-sync.js:293:33 at Array.forEach (<anonymous>) at _recursivelyIncludeAll (E:\planka\server\node_modules\include-all\lib\help-include-all-sync.js:178:11) at includeAll (E:\planka\server\node_modules\include-all\lib\help-include-all-sync.js:317:5) at helpBuildDictionary (E:\planka\server\node_modules\include-all\lib\help-build-dictionary.js:46:13) at module.exports.aggregate (E:\planka\server\node_modules\include-all\index.js:101:10) at loadOtherConfigFiles (E:\planka\server\node_modules\sails\lib\hooks\moduleloader\index.js:162:22) at runTask (E:\planka\server\node_modules\async\dist\async.js:1637:13) at E:\planka\server\node_modules\async\dist\async.js:1575:13 ``` I have a guess that something is wrong with Sails. But I didn't find any solution how to fix it. I tried to repeat all steps on win11 and WinServer2012R2, but results are the same npm and system info: ```powershell npm version { npm: '10.0.0', node: '18.17.1', acorn: '8.8.2', ada: '2.5.0', ares: '1.19.1', brotli: '1.0.9', cldr: '43.0', icu: '73.1', llhttp: '6.0.11', modules: '108', napi: '9', nghttp2: '1.52.0', nghttp3: '0.7.0', ngtcp2: '0.8.1', openssl: '3.0.10+quic', simdutf: '3.2.12', tz: '2023c', undici: '5.22.1', unicode: '15.0', uv: '1.44.2', uvwasi: '0.0.18', v8: '10.2.154.26-node.26', zlib: '1.2.13.1-motley' } ``` Please help me to overcome this problem
Author
Owner

@meltyshev commented on GitHub (Sep 11, 2023):

Hi! Sorry for the late reply.
It seems the latest version in the master branch is not fully ready for production use. There are missing checks for OIDC environment variables, which I want to add soon. You can use the version from here https://github.com/plankanban/planka/releases/tag/v1.12.0 or if you need OIDC, you have to add environment variables to the server/.env file.

@meltyshev commented on GitHub (Sep 11, 2023): Hi! Sorry for the late reply. It seems the latest version in the master branch is not fully ready for production use. There are missing checks for OIDC environment variables, which I want to add soon. You can use the version from here https://github.com/plankanban/planka/releases/tag/v1.12.0 or if you need OIDC, you have to add [environment variables](https://docs.planka.cloud/docs/Configuration/OIDC) to the `server/.env` file.
Author
Owner

@meltyshev commented on GitHub (Sep 12, 2023):

Should be fixed. Please do git pull to update the code.

@meltyshev commented on GitHub (Sep 12, 2023): Should be fixed. Please do `git pull` to update the code.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/planka#354