question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[build] TypeError [ERR_INVALID_CALLBACK] ?

See original GitHub issue

Hi. I got a type error during build. ‘keycloak_11.0.3_builtin_themes.zip’ saved but there is an error for callback.

...
 11650K .......... .......... .......... .......... .......... 99% 3.26M 0s
 11700K .......... .......... .......... .......... .......... 99% 4.71M 0s
 11750K .......... .......... .......... .......... .......... 99% 2.75M 0s
 11800K .......... .....                                      100% 3.30M=3.6s

2021-09-29 14:37:02 (3.23 MB/s) - ‘keycloak_11.0.3_builtin_themes.zip’ saved [12098580/12098580]

fs.js:177
    throw new ERR_INVALID_CALLBACK(cb);
    ^

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined
    at makeCallback (fs.js:177:11)
    at Object.mkdir (fs.js:978:14)
    at Object.target.init (/home/cindy/.nvm/versions/node/v14.17.1/lib/node_modules/mvn/target.js:25:10)
    at Object.<anonymous> (/home/cindy/.nvm/versions/node/v14.17.1/lib/node_modules/mvn/target.js:39:8)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:14)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:92:18) {
  code: 'ERR_INVALID_CALLBACK'
}
child_process.js:682
    throw err;
    ^

Error: Command failed: mvn package
fs.js:177
    throw new ERR_INVALID_CALLBACK(cb);
    ^

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined
    at makeCallback (fs.js:177:11)
    at Object.mkdir (fs.js:978:14)
    at Object.target.init (/home/cindy/.nvm/versions/node/v14.17.1/lib/node_modules/mvn/target.js:25:10)
    at Object.<anonymous> (/home/cindy/.nvm/versions/node/v14.17.1/lib/node_modules/mvn/target.js:39:8)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:14)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:92:18) {
  code: 'ERR_INVALID_CALLBACK'
}

    at checkExecSyncError (child_process.js:643:11)
    at Object.execSync (child_process.js:679:15)
    at main (/home/cindy/dev/ndc-ui/node_modules/keycloakify/bin/build-keycloak-theme/build-keycloak-theme.js:80:19)
    at Object.<anonymous> (/home/cindy/dev/ndc-ui/node_modules/keycloakify/bin/build-keycloak-theme/index.js:17:37)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)

    at internal/main/run_main_module.js:17:47 {
  status: 1,
  signal: null,
  output: [
    null,
    Buffer(0) [Uint8Array] [],
    Buffer(840) [Uint8Array] [
      102, 115,  46, 106, 115,  58,  49, 55,  55,  10,  32,  32,
       32,  32, 116, 104, 114, 111, 119, 32, 110, 101, 119,  32,
       69,  82,  82,  95,  73,  78,  86, 65,  76,  73,  68,  95,
       67,  65,  76,  76,  66,  65,  67, 75,  40,  99,  98,  41,
       59,  10,  32,  32,  32,  32,  94, 10,  10,  84, 121, 112,
      101,  69, 114, 114, 111, 114,  32, 91,  69,  82,  82,  95,
       73,  78,  86,  65,  76,  73,  68, 95,  67,  65,  76,  76,
       66,  65,  67,  75,  93,  58,  32, 67,  97, 108, 108,  98,
       97,  99, 107,  32,
      ... 740 more items
    ]
  ],
  pid: 10978,
  stdout: Buffer(0) [Uint8Array] [],
  stderr: Buffer(840) [Uint8Array] [
    102, 115,  46, 106, 115,  58,  49, 55,  55,  10,  32,  32,
     32,  32, 116, 104, 114, 111, 119, 32, 110, 101, 119,  32,
     69,  82,  82,  95,  73,  78,  86, 65,  76,  73,  68,  95,
     67,  65,  76,  76,  66,  65,  67, 75,  40,  99,  98,  41,
     59,  10,  32,  32,  32,  32,  94, 10,  10,  84, 121, 112,
    101,  69, 114, 114, 111, 114,  32, 91,  69,  82,  82,  95,
     73,  78,  86,  65,  76,  73,  68, 95,  67,  65,  76,  76,
     66,  65,  67,  75,  93,  58,  32, 67,  97, 108, 108,  98,
     97,  99, 107,  32,
    ... 740 more items
  ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ndc-ui@0.1.0 keycloak: `craco build && build-keycloak-theme`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ndc-ui@0.1.0 keycloak script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

May I know what am I missing? Is there a problem with the configuration of the environment?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
MeXaaRcommented, Mar 13, 2022

Yep, that worked thanks

1reaction
cindy-choicommented, Sep 29, 2021

@garronej I found it was maven issue in my local 😃 (It was mvn, not maven) So close this issue. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to fix this error TypeError [ERR_INVALID_CALLBACK ...
Fs.writeFile() according to the documentation here takes ( file, data[, options]and callback ) params so your code will be like this :
Read more >
Callback must be a function. Received undefined
I m using nodejs, I got the following error while appending a file. ... TypeError [ERR_INVALID_CALLBACK]: Callback must be a function.
Read more >
TypeError [ERR_INVALID_CALLBACK]: Callback must be a ...
Receiving: TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined at maybeCallback (node:fs:175:3) at Object.
Read more >
Errors | Node.js v19.3.0 Documentation
Class: TypeError; Exceptions vs. errors; OpenSSL errors ... When the operation either completes or an error is raised, the callback function is called...
Read more >
TypeError: "x" is not a function - JavaScript - MDN Web Docs
A typo in the function name · Function called on the wrong object · Function shares a name with a pre-existing property ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found