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

tap({ dest: 'customize-cra.log' }). throw new ERR_INVALID_CALLBACK(cb); #295

Open
tomatobybike opened this issue May 12, 2021 · 3 comments

Comments

@tomatobybike
Copy link

tomatobybike commented May 12, 2021

``

addPostcssPlugins([
    require('postcss-px-to-viewport')({
      ...
    })
  ]),
  addWebpackModuleRule(
    {
      test: /\.less$/,
      use: ['style-loader', 'css-loader', 'less-loader', {
        loader: 'style-resources-loader',
        options: {
            patterns: [
                './src/global/*.less'
            ]
        }
      }]
    }
  ),

``

yarn run build

then throw error:

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

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined

@aliokan
Copy link

aliokan commented May 20, 2021

same here, with "customize-cra": "1.0.0" and tap({ dest: 'customize-cra.log' }), I got

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

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined
    at maybeCallback (fs.js:160:9)
    at Object.appendFile (fs.js:1483:14)
    at Object.<anonymous> (/home/path/furnish/node_modules/customize-cra/dist/index.cjs.js:1:1166)
    at Object.webpack (/home/path/furnish/node_modules/lodash.flow/index.js:177:42)
    at /home/path/furnish/node_modules/react-app-rewired/scripts/build.js:26:24
    at Object.<anonymous> (/home/path/furnish/node_modules/react-scripts/scripts/build.js:67:16)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14) {
  code: 'ERR_INVALID_CALLBACK'
}

@aliokan
Copy link

aliokan commented May 20, 2021

as a workaround :
tap({ message: 'Pre - Customizers' }) + yarn build > customize-cra.log

@tomatobybike
Copy link
Author

tomatobybike commented Jun 16, 2021

utilities.js
line 45
if (dest) { const fs = require('fs') fs.appendFile(dest,${print.join('\n')}\n) }
shoud change to

if (dest) { const fs = require('fs') fs.appendFile(dest,${print.join('\n')}\n`,()=>{})
}

`

fs.appendFile function node Version > 16 need callback function

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

2 participants