0

I have a project, the caul all the operative part works. But when displaying images, loading resources, the elements are recognized by the browser, they are transferred, but they are not read. navegator net log

I have reinstalled laravel, composer, npm and nothing works. The result is the same.

composer.json

    {
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "require": {
        "php": "^7.3|^8.0",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^7.0.1",
        "laracasts/flash": "^3.2",
        "laravel/framework": "^8.65",
        "laravel/sanctum": "^2.11",
        "laravel/tinker": "^2.5",
        "laravel/ui": "^3.4",
        "laravelcollective/html": "^6.2",
        "phpmailer/phpmailer": "^6.5",
        "yajra/laravel-datatables-oracle": "~9.0"
    },
    "require-dev": {
        "facade/ignition": "^2.5",
        "fakerphp/faker": "^1.9.1",
        "laravel/breeze": "^1.5",
        "laravel/sail": "^1.0.1",
        "mockery/mockery": "^1.4.4",
        "nunomaduro/collision": "^5.10",
        "phpunit/phpunit": "^9.5.10"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-update-cmd": [
            "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    },
    "extra": {
        "laravel": {
            "dont-discover": 
        [
            "laravel/dusk"
        ]
        }
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

package.json

    {
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "mix",
        "watch": "mix watch",
        "watch-poll": "mix watch -- --watch-options-poll=1000",
        "hot": "mix watch --hot",
        "prod": "npm run production",
        "production": "mix --production"
    },
    "devDependencies": {
        "@popperjs/core": "^2.10.2",
        "@tailwindcss/forms": "^0.2.1",
        "alpinejs": "^3.4.2",
        "autoprefixer": "^10.1.0",
        "axios": "^0.21",
        "bootstrap": "^5.1.3",
        "lodash": "^4.17.19",
        "postcss": "^8.2.1",
        "postcss-import": "^12.0.1",
        "resolve-url-loader": "^4.0.0",
        "sass": "^1.32.11",
        "sass-loader": "^11.1.1",
        "tailwindcss": "^2.0.2"
    },
    "dependencies": {
        "esrecurse": "^4.3.0",
        "internal-ip": "^7.0.0",
        "querystring": "^0.2.1"
    }
}

The app.js is not loading me either console log

  • Hi, okay so please try adding the app.js as follows and test it `` in your main layouts file. If you're already doing this, are you running `npm run watch` (once) or `npm run dev` each time you add code to the JS file? – DerickMasai Dec 19 '21 at 21:37
  • I detected that I had a very old version of node, I just upgraded to version 17.3.0 and npm version 8.3.0. When executing: npm run watch I have the output: > watch > mix watch sh: 1: mix: not found and when executing npm run dev > dev > npm run development > development > mix sh: 1: mix: not found I have seen other other links (https://stackoverflow.com/questions/65718391/laravel-npm-command-mix-not-found) and they recommend removing node_modules, reinstalling and adding other packages. The result is the same :( – Luis Roberto Macias Alejos Dec 21 '21 at 05:21
  • Hmm, this sounds like a case where you may need to overhaul the entire environment to remove the corrupted parts which may have gotten worse and reinstalling and adding other packages. – DerickMasai Dec 22 '21 at 00:17

2 Answers2

1

The problem persisted, I had to lower the laravel version to 7, install nodejs version 16, npm version 8.

Remove directories: node_modules and vendor. Delete the files: package-lock.json and composer.lock

Then run: composer install npm install && npm run dev

I upgraded to Laravel version 8 composer update (resolve all dependencies) npm install && npm run dev

And there it worked.

0

Update your laravel-mix

npm install laravel-mix@latest

Clean npm install

npm clean-install

Then run

npm install && npm run dev
Atif Bashir
  • 319
  • 4
  • 13