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

Release 1.14.1 dist doesn't reflect latest source changes #362

Closed
andriesreitsma opened this issue Nov 22, 2022 · 4 comments
Closed

Release 1.14.1 dist doesn't reflect latest source changes #362

andriesreitsma opened this issue Nov 22, 2022 · 4 comments
Labels

Comments

@andriesreitsma
Copy link

  • Echo Version: 1.14.1
  • NPM Version: 8.13.1
  • Node Version: v16.15.0

Description:

It could be something really stupid and maybe I overlooked something, so tried it first with a few clean installs to confirm that somehow the recent changes from pull-request #359 don't seem to be part of the compiled code when pulling in the update though npm update going from version 1.14.0 to 1.14.1 and also when doing a complete clean npm install with the whole node_modules folder removed.

The added instantiation of Pusher in src/connector/pusher-connector.ts therefor doesn't work and gives the error:

ReferenceError: Pusher is not defined
    at PusherConnector.connect (/home/forge/example.com/node_modules/laravelecho/dist/echo.common.js:1039:27)

When I go to the folder node_modules/laravel-echo/ and run npm install it starts compiling the source and updates the dist resulting in working code.

Steps To Reproduce:

I used a clean install of https://github.com/laravel/breeze-next and went though all the steps provided in the readme. After that I added laravel-echo as a dependency:

npm install --save-dev laravel-echo pusher-js

Once Echo is installed, I created a new lib using an Echo instance using Pusher in my application's JavaScript as src/lib/echo.js with the following code:

import Pusher from "pusher-js"
import Echo from "laravel-echo"

const echo = new Echo({
    Pusher,
    broadcaster: 'pusher',
    key: process.env.NEXT_PUBLIC_PUSHER_APP_KEY,
    wsHost: process.env.NEXT_PUBLIC_PUSHER_HOST,
    wsPort: process.env.NEXT_PUBLIC_PUSHER_PORT,
    wssPort: process.env.NEXT_PUBLIC_PUSHER_PORT,
    forceTLS: false,
    encrypted: true,
    disableStats: true,
    enabledTransports: ['ws', 'wss'],
})

export default echo

Now when you run npm run build it will fail resulting in the error:

ReferenceError: Pusher is not defined
    at PusherConnector.connect (/home/forge/example.com/node_modules/laravelecho/dist/echo.common.js:1039:27)
    ...

When compiling the source within node_modules and running npm run build again, it will continue and successfully build.

@andriesreitsma andriesreitsma changed the title Release 1.4.1 dist doesn't reflect latest source changes Release 1.14.1 dist doesn't reflect latest source changes Nov 22, 2022
@driesvints
Copy link
Member

@jessarcher @timacdonald @taylorotwell seems like we have the same issue here.

@driesvints driesvints added the bug label Nov 22, 2022
@andriesreitsma
Copy link
Author

FYI:

When compiling I kept running into an error regarding a duplicate declaration of AbortSignal, a small search learned me that an update of @types/node to ^18.11.9 was needed in you package.json because of conflicting types. I do not take responsibility for compatibility issues ;-) I just wanted to get rid of the error and everything seems to work fine this way at my end.

@taylorotwell
Copy link
Member

Pushed 1.14.2 - does that fix it? @andriesreitsma

@andriesreitsma
Copy link
Author

It does @taylorotwell, thanks for getting to this so quickly! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants