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

Can't start craco - cannot read 'push' from undefined error #24

Open
sigmasoldi3r opened this issue Apr 21, 2022 · 1 comment
Open

Can't start craco - cannot read 'push' from undefined error #24

sigmasoldi3r opened this issue Apr 21, 2022 · 1 comment

Comments

@sigmasoldi3r
Copy link

Hello! I was giving a try to this plugin, but I can't figure out how to make it run, here is the error:

C:\my-project>yarn start
yarn run v1.21.1
$ craco start
(node:11068) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'push' of undefined
    at Object.overrideWebpackConfig (C:\my-project\node_modules\@baristalabs\craco-raw-loader\lib\craco-raw-loader.js:47:36)
    at overrideWebpack (C:\my-project\node_modules\@craco\craco\lib\features\plugins.js:42:40)
    at C:\my-project\node_modules\@craco\craco\lib\features\plugins.js:64:29
    at Array.forEach (<anonymous>)
    at applyWebpackConfigPlugins (C:\my-project\node_modules\@craco\craco\lib\features\plugins.js:63:29)
    at mergeWebpackConfig (C:\my-project\node_modules\@craco\craco\lib\features\webpack\merge-webpack-config.js:110:30)
    at overrideWebpackDev (C:\my-project\node_modules\@craco\craco\lib\features\webpack\override.js:11:36)
    at C:\my-project\node_modules\@craco\craco\scripts\start.js:27:5
(Use `node --trace-warnings ...` to show where the warning was created)
(node:11068) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:11068) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Done in 9.77s.

My .cracorc.ts configuration file looks like the following:

import { CracoConfig } from '@craco/craco'
const CracoRawLoaderPlugin = require('@baristalabs/craco-raw-loader')

export default {
  plugins: [
    {
      plugin: CracoRawLoaderPlugin,
      options: {
        test: /\.txt$/,
      },
    },
  ],
} as CracoConfig

(Also tried importing the plugin with import either as namespace or default, but without sucess)

Node version v14.17.0

@Time-year
Copy link

Hello, is there a solution to this problem? I met the same problem when I tried the plug-in

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