Why Npm run watch giving to me TypeError: text.forEach is not a function

After half day I fixed that issue.

  1. I find this how to update dependencies. So I decided to follow an advice and try to update my dependencies. After that I get another error:

[webpack-cli] Error: Unknown option '--hide-modules'
[webpack-cli] Run 'webpack --help' to see available commands and options
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ development: cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch"
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

  1. So I just remove --hide-modules and get another error:
    solution comes from here: Unknown argument: --hide-modules

ERROR in ./resources/assets/js/components/ExampleComponent.vue 1:0
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|
|
webpack compiled with 1 error

  1. For this error i find solution there: “You may need an appropriate loader” for template tags
    So I just change my webpack.mix.js from:

mix.js('resources/assets/js/app.js', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css');

to:

mix.js('resources/assets/js/app.js', 'public/js').vue()
.sass('resources/assets/sass/app.scss', 'public/css');

and it's fixed my issue. Maybe it helps for someone to save time on it


I find my answer for with error after 3 day

first I sould sey is see hare https://github.com/laravel-mix/laravel-mix/issues/2450

this issues seid problem is from "laravel-mix": "^5.0.4" to "laravel-mix": "^5.0.5"

next install css-loader v3.5.3

     $ npm uninstall --save-dev css-loader
     $ npm install --save-dev [email protected]

If you have problem with this you should use sass-loader v7.1.0 and node-sass v4.14.1

    // package.json
    "css-loader": "^3.5.3",
    "laravel-mix": "^5.0.4",
    "node-sass": "^4.14.1",
    "sass-loader": "^7.1.0",