question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

1.7.0 release does not work in IE 11

See original GitHub issue
  • Echo Version: 1.7.0
  • Laravel Version: 6.18.6
  • PHP Version: 7.3
  • NPM Version: 6.14.4
  • Node Version: 10.20.1

Description:

When compiling a Laravel environment that includes the normal echo code in the app.js file, for example;

` 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 }); `

After compilation, viewing the page using IE11 results in a syntax error which points to this piece of code;

class Connector { /** * Create a new class instance. */ constructor(options) { /** * Default connector options. */ this._defaultOptions = { auth: { headers: {}, }, authEndpoint: '/broadcasting/auth', broadcaster: 'pusher', csrfToken: null, host: null, key: null, namespace: 'App.Events', }; this.setOptions(options); this.connect(); } /** * Merge the custom options with the defaults. */ setOptions(options) { this.options = Object.assign(this._defaultOptions, options); if (this.csrfToken()) { this.options.auth.headers['X-CSRF-TOKEN'] = this.csrfToken(); } return options; } /** * Extract the CSRF token from the page. */ csrfToken() { let selector; if (typeof window !== 'undefined' && window['Laravel'] && window['Laravel'].csrfToken) { return window['Laravel'].csrfToken; } else if (this.options.csrfToken) { return this.options.csrfToken; } else if (typeof document !== 'undefined' && typeof document.querySelector === 'function' && (selector = document.querySelector('meta[name="csrf-token"]'))) { return selector.getAttribute('content'); } return null; } }

Steps To Reproduce:

Build a basic laravel app with vue front end using the versions above. Add in the code above to include Echo in something like app.js Try to load the page in IE, it does not load Repeat the same process using version 1.6.1 of Echo, syntax error goes away and page loads

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
derekmdcommented, May 16, 2020

I submitted a pull request today that will make echo.js again compile down to ES5 and it also includes the Object.assign() polyfill for IE11.

FYI, if this happens with other NPM packages where only an ES6 distribution is given, Laravel Mix has the ability to ES5-transpile that at the app level instead. Add the below snippet to your webpack.mix.js config to transpile node_modules/laravel-echo/**/*.js.

mix.webpackConfig({
    module: {
        rules: [
            {
                test: /\.jsx?$/,
                exclude: /node_modules\/(?!(laravel-echo))/,
                use: [
                    {
                        loader: 'babel-loader',
                        options: Config.babel()
                    }
                ]
            },
        ]
    }
});
1reaction
bengalliennecommented, Apr 16, 2020

So after a bit of digging around it seems that (for some reason), that piece of code is not getting transpiled down to native javascript in version 1.7.0 whereas it does in 1.6.1. In 1.7.0 the compiled file still has ES6 in it, which IE11 doesn’t understand. Have you changed how you are compiling the code at all?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Java (JRE 1.7.45) not working Internet Explorer 11 and ...
I can't get Java to work on IE 11 for an intranet site (Documentum Webtop 6.7), so far I've: Enable Java in browser...
Read more >
Developer tools not working (DOM Parser not loading) in IE11 ...
Hi,. first go tools>Internet Options>advanced tab, check "Always record developer console messages". Save changes. Open IE at a blank tab ...
Read more >
applet issue forms 11g in IE 11 jre 1.7.0.80 — oracle-tech
I have installed weblogic 10.3.6 on window 2012 r2 with forms 11.1.2.2.0 64 bit. Both admin server and managed servers are in running...
Read more >
java - deployJava.js not detecting JRE in IE 11 - Stack Overflow
The "deployJava.js" library has it's own browser detection function (getBrowser()) and it does not handle the user agent for IE11 correctly.
Read more >
November 2022 (version 1.74) - Visual Studio Code
2: The update addresses these issues. Downloads: Windows: User System Arm64 | Mac: Universal Intel silicon | Linux: deb rpm tarball Arm snap....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found