Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Web sockets - pusher replacement - doesn't work

    Bug Report
    3
    10
    645
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      Ashrakat Mokhtar last edited by

      #pusher
      #laravel_echo

      1 Reply Last reply Reply Quote 0
      • V
        Vaishali Agarwal last edited by

        @Ashrakat-Mokhtar
        could you please provide more detail about your query!

        1 Reply Last reply Reply Quote 0
        • A
          Ashrakat Mokhtar last edited by

          @Vaishali-Agarwal
          Now I'm using web-sockets - pusher replacement in laravel - I have followed this steps https://beyondco.de/docs/laravel-websockets/basic-usage/pusher
          But yet it tells me that Echo is not defined, However I have written its configuration in resources/assets/js/bootstrap.js
          It seems it doesn't read from this file.
          Here's code written:

          import Echo from 'laravel-echo'

          window.Pusher = require('pusher-js');

          window.Echo = new Echo({
          broadcaster: 'pusher',
          key: process.env.MIX_PUSHER_APP_KEY,
          cluster: process.env.MIX_PUSHER_APP_CLUSTER,
          encrypted: true,
          wsHost: window.location.hostname,
          wsPort: 6001
          });

          1 Reply Last reply Reply Quote 0
          • A
            Ashrakat Mokhtar last edited by

            Any help??
            It's mandatory.

            1 Reply Last reply Reply Quote 0
            • devansh-webkul
              devansh-webkul last edited by

              Hi @Ashrakat-Mokhtar,

              I think compilation is missing did you compiled your code properly. Because I did not see anything wrong with your code.

              1 Reply Last reply Reply Quote 0
              • A
                Ashrakat Mokhtar last edited by Ashrakat Mokhtar

                @devansh-webkul I did, I ran 'npm run dev', 'npm run watch', still the same problem.
                somehow it's not reading from that file 'resources/assets/js/bootstrap.js'.

                1 Reply Last reply Reply Quote 0
                • devansh-webkul
                  devansh-webkul last edited by

                  Hi @Ashrakat-Mokhtar,

                  Just check if echo dependencies are installed or not this seems to be a configuration issue.

                  1 Reply Last reply Reply Quote 0
                  • A
                    Ashrakat Mokhtar last edited by Ashrakat Mokhtar

                    @devansh-webkul I have "laravel-echo" => "^1.10.0" & "pusher-js" => "^7.0.3" in my package.json file,
                    "pusher/pusher-php-server" => "^5.0" & "beyondcode/laravel-websockets" => "^1.12" in composer.json file.

                    Is there anything else missing??

                    1 Reply Last reply Reply Quote 0
                    • devansh-webkul
                      devansh-webkul last edited by

                      @Ashrakat-Mokhtar,

                      Your error clearly signifies that the echo is not defined. That means echo is not importing if something is not importing then either dependency issue or path issue.

                      1 Reply Last reply Reply Quote 0
                      • A
                        Ashrakat Mokhtar last edited by Ashrakat Mokhtar

                        @devansh-webkul Now error is resolved and read properly, however it's not listening correctly in front-end, backend is working fine. but in html page no rendering is happening when action is taking. it doesn't listen to the event fired in backend.

                        imageedit_2_6875692373.png

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post