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.

Edge: Object doesn't support property or method "finally'

See original GitHub issue

Bug report

Describe the bug

While in development mode, when starting my app in Edge, I receive a TypeError stating that Object doesn’t support property or method ‘finally’.

TypeError: Object doesn't support property or method 'finally'

FetchTransport.prototype.open
./node_modules/next/dist/client/event-source-polyfill.js:473
  470 | var signal = controller.signal; // see #120
  471 | 
  472 | var textDecoder = new TextDecoder();
> 473 | unfetch_1.default(url, {
      | ^
  474 |   headers: headers,
  475 |   credentials: withCredentials ? 'include' : 'same-origin',
  476 |   signal: signal,

onTimeout
./node_modules/next/dist/client/event-source-polyfill.js:920
  917 | }
  918 | 
  919 | try {
> 920 |   transport.open(xhr, onStart, onProgress, onFinish, requestURL, withCredentials, requestHeaders);
      | ^
  921 | } catch (error) {
  922 |   close();
  923 |   throw error;

start
./node_modules/next/dist/client/event-source-polyfill.js:931
  928 |   es.readyState = CONNECTING;
  929 |   es.withCredentials = withCredentials;
  930 |   es._close = close;
> 931 |   onTimeout();
  932 | }
  933 | 
  934 | EventSourcePolyfill.prototype = (0, _create.default)(EventTarget.prototype);

EventSourcePolyfill
./node_modules/next/dist/client/event-source-polyfill.js:654
  651 |   this.readyState = undefined;
  652 |   this.withCredentials = undefined;
  653 |   this._close = undefined;
> 654 |   start(this, url, options);
  655 | }
  656 | 
  657 | var isFetchSupported = unfetch_1.default != undefined && Response != undefined && 'body' in Response.prototype;

init
./node_modules/next/dist/client/dev-error-overlay/eventsource.js:24
  21 | }, options.timeout / 2);
  22 | 
  23 | function init() {
> 24 |   source = new window.EventSource(options.path);
     | ^
  25 |   source.onopen = handleOnline;
  26 |   source.onerror = handleDisconnect;
  27 |   source.onmessage = handleMessage;

EventSourceWrapper
./node_modules/next/dist/client/dev-error-overlay/eventsource.js:16
  13 |   options.timeout = 20 * 1000;
  14 | }
  15 | 
> 16 | init();
     | ^
  17 | var timer = setInterval(function () {
  18 |   if (new Date() - lastActivity > options.timeout) {
  19 |     handleDisconnect();

getEventSourceWrapper
./node_modules/next/dist/client/dev-error-overlay/eventsource.js:64
  61 | if (!window.__whmEventSourceWrapper[options.path]) {
  62 |   // cache the wrapper for other entries loaded on
  63 |   // the same page with the same options.path
> 64 |   window.__whmEventSourceWrapper[options.path] = EventSourceWrapper(options);
     | ^
  65 | }
  66 | 
  67 | return window.__whmEventSourceWrapper[options.path];

connect
./node_modules/next/dist/client/dev-error-overlay/hot-dev-client.js:110
  107 |   });
  108 | }
  109 | 
> 110 | eventsource_1.getEventSourceWrapper(options).addMessageListener(function (event) {
      | ^
  111 |   // This is the heartbeat event
  112 |   if (event.data === "\uD83D\uDC93") {
  113 |     return;

exports.default
./node_modules/next/dist/client/webpack-hot-middleware-client.js:24
  21 | var options = {
  22 |   path: "".concat(assetPrefix, "/_next/webpack-hmr")
  23 | };
> 24 | var devClient = hot_dev_client_1.default(options);
     | ^
  25 | devClient.subscribeToHmrEvent(function (obj) {
  26 |   if (obj.action === 'reloadPage') {
  27 |     return window.location.reload();

./node_modules/next/dist/client/next-dev.js
./node_modules/next/dist/client/next-dev.js:45
  42 | var _window = window,
  43 |     assetPrefix = _window.__NEXT_DATA__.assetPrefix;
  44 | var prefix = assetPrefix || '';
> 45 | var webpackHMR = webpack_hot_middleware_client_1.default({
  46 |   assetPrefix: prefix
  47 | });
  48 | window.next = next;

__webpack_require__
./webpack/bootstrap:788
  785 | // Execute the module function
  786 | var threw = true;
  787 | try {
> 788 | 	modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
      | ^
  789 | 	threw = false;
  790 | } finally {
  791 | 	if(threw) delete installedModules[moduleId];

checkDeferredModules
./webpack/bootstrap:45
  42 | 	}
  43 | 	if(fulfilled) {
  44 | 		deferredModules.splice(i--, 1);
> 45 | 		result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
     | ^
  46 | 	}
  47 | }
  48 | return result;

webpackJsonpCallback
./webpack/bootstrap:32
  29 | 	deferredModules.push.apply(deferredModules, executeModules || []);
  30 | 
  31 | 	// run deferred modules when all chunks ready
> 32 | 	return checkDeferredModules();
     | ^
  33 | };
  34 | function checkDeferredModules() {
  35 | 	var result;

To Reproduce

Direct the browser to any page of the application.

Expected behavior

The error should be avoided and the app should load normally.

System information

  • OS: Windows 10
  • Browser (if applies) Edge
  • Version of Next.js: 8.0.4

Additional context

This issue appears to be related to the development mode only, when the app is compiled and run it works fine in Edge. Also, everything appears to be fine in IE 11, I am only having this issue in Edge.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
dawsbotcommented, Sep 16, 2020

@andfk we no longer have this error and are using next@9.5.3.

I’m not sure when in-between 9.2 and 9.5.3 this was fixed, but we no longer have this error 🥳

2reactions
dawsbotcommented, Sep 16, 2020

EDIT: We’ve fixed this by upgrading to next@9.5.3.


We’re running Next 9.2 and it appears we have this error in production. Is this still a bug if we’re getting the error in a dependency?

You can replicate this by opening https://epdev123.org in edge (we did it with Edge 15 via https://browserstack.com)

The image

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Object doesn't support property or method 'finally'
For my application I was using https://cdnjs.com/libraries/es6-promise to polyfill Promise (initially this was solely to polyfill for IE 11).
Read more >
[Vue warn]: Error in created hook: "TypeError: Object doesn't ...
Everything working in all browsers, I am getting this error on Edge and IE. ... “TypeError: Object doesn't support property or method 'finally'”...
Read more >
FIX: "SCRIPT438: Object doesn't support property or method ...
Fixes an issue in which you receive an error message when you visit a .NET Framework 3.5-based ASP.NET webpage in Internet Explorer 10....
Read more >
Error | Object Doesn't Support Property Or Method 'Includes' In ...
Ways to Fixed the error · 1. Use indexOf() method instead of includes() method · 2. Use the polyfill.
Read more >
Object doesn't support property or method 'scrollTo'
Even if Edge is not called Internet Explorer, it's still basically IE. And IEs don't support scrollTo. Don't use scrollTo, use scrollLeft ...
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