Echo Version
2.2.0
Laravel Version
12.4.0
PHP Version
8.2.29
NPM Version
24.6.0
Database Driver & Version
No response
Description
Hello team, and thanks for the great package!
This issue might be related to this, but instead of React, it is on React Native project. Since the server uses Reverb, I choose to use Laravel Echo on the client. Based on this PR, I see this additional import.meta.env type check, but on Metro it immediately refuses to acknowledge import.meta as it is unsupported.
So my temporary solution is to comment out the defaults which uses import.meta.env altogether, then rebuilt the dist folder. This works, but I have to do this patch everytime new release comes in.
const defaults: ConfigDefaults<BroadcastDriver> = {
reverb: {
broadcaster: "reverb",
- key: import.meta.env.VITE_REVERB_APP_KEY,
- wsHost: import.meta.env.VITE_REVERB_HOST,
- wsPort: import.meta.env.VITE_REVERB_PORT,
- wssPort: import.meta.env.VITE_REVERB_PORT,
- forceTLS:
- (import.meta.env.VITE_REVERB_SCHEME ?? "https") === "https",
+ // key: import.meta.env.VITE_REVERB_APP_KEY,
+ // wsHost: import.meta.env.VITE_REVERB_HOST,
+ // wsPort: import.meta.env.VITE_REVERB_PORT,
+ // wssPort: import.meta.env.VITE_REVERB_PORT,
+ // forceTLS:
+ // (import.meta.env.VITE_REVERB_SCHEME ?? "https") === "https",
+ forceTLS: true,
enabledTransports: ["ws", "wss"],
},
...
I'm thinking the config can use some kind of flag to indicate whether the defaults can grab from import.meta.env (which Vite projects most certainly uses), so that it doesn't have to rely on import.meta.env, hence won't do the type checking (e.g. useImportMetaEnvForDefaults which defaults to true if not provided), but I'm curious about your thoughts on this. Thanks in advance!
Steps To Reproduce
.
Echo Version
2.2.0
Laravel Version
12.4.0
PHP Version
8.2.29
NPM Version
24.6.0
Database Driver & Version
No response
Description
Hello team, and thanks for the great package!
This issue might be related to this, but instead of React, it is on React Native project. Since the server uses Reverb, I choose to use Laravel Echo on the client. Based on this PR, I see this additional
import.meta.envtype check, but on Metro it immediately refuses to acknowledgeimport.metaas it is unsupported.So my temporary solution is to comment out the defaults which uses
import.meta.envaltogether, then rebuilt thedistfolder. This works, but I have to do this patch everytime new release comes in.const defaults: ConfigDefaults<BroadcastDriver> = { reverb: { broadcaster: "reverb", - key: import.meta.env.VITE_REVERB_APP_KEY, - wsHost: import.meta.env.VITE_REVERB_HOST, - wsPort: import.meta.env.VITE_REVERB_PORT, - wssPort: import.meta.env.VITE_REVERB_PORT, - forceTLS: - (import.meta.env.VITE_REVERB_SCHEME ?? "https") === "https", + // key: import.meta.env.VITE_REVERB_APP_KEY, + // wsHost: import.meta.env.VITE_REVERB_HOST, + // wsPort: import.meta.env.VITE_REVERB_PORT, + // wssPort: import.meta.env.VITE_REVERB_PORT, + // forceTLS: + // (import.meta.env.VITE_REVERB_SCHEME ?? "https") === "https", + forceTLS: true, enabledTransports: ["ws", "wss"], }, ...I'm thinking the config can use some kind of flag to indicate whether the defaults can grab from
import.meta.env(which Vite projects most certainly uses), so that it doesn't have to rely onimport.meta.env, hence won't do the type checking (e.g.useImportMetaEnvForDefaultswhich defaults totrueif not provided), but I'm curious about your thoughts on this. Thanks in advance!Steps To Reproduce
.