• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
Bagisto Forum

Bagisto

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

Web sockets - pusher replacement - doesn't work

Bug Report
3
10
665
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 28 Apr 2021, 12:48

    #pusher
    #laravel_echo

    1 Reply Last reply Reply Quote 0
    • V
      Vaishali Agarwal last edited by 28 Apr 2021, 14:55

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

      1 Reply Last reply Reply Quote 0
      • A
        Ashrakat Mokhtar last edited by 28 Apr 2021, 15:09

        @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 29 Apr 2021, 15:18

          Any help??
          It's mandatory.

          1 Reply Last reply Reply Quote 0
          • devansh-webkul
            devansh-webkul last edited by 30 Apr 2021, 04:32

            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 2 May 2021, 10:27 2 May 2021, 10:21

              @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 3 May 2021, 04:01

                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 3 May 2021, 19:35 3 May 2021, 19:18

                  @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 4 May 2021, 04:12

                    @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 4 May 2021, 15:34 4 May 2021, 15:24

                      @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
                      5 out of 10
                      • First post
                        5/10
                        Last post