Closed suyesh closed 5 years ago
RangeError: Invalid array length new SuperCluster node_modules/supercluster/index.js:14 11 | 12 | function SuperCluster(options) { 13 | this.options = extend(Object.create(this.options), options);
14 | this.trees = new Array(this.options.maxZoom + 1); 15 | } 16 | 17 | SuperCluster.prototype = { View compiled Function.supercluster [as default] node_modules/supercluster/index.js:9 6 | module.exports.default = supercluster; 7 | 8 | function supercluster(options) { 9 | return new SuperCluster(options); 10 | } 11 | 12 | function SuperCluster(options) { View compiled new Cluster node_modules/react-mapbox-gl/lib/cluster.js:24 21 | function Cluster() { 22 | var _this = _super !== null && _super.apply(this, arguments) || this; 23 | _this.state = { 24 | superC: supercluster_1.default({ 25 | radius: _this.props.radius, 26 | maxZoom: _this.props.maxZoom, 27 | minZoom: _this.props.minZoom, View compiled constructClassInstance node_modules/react-dom/cjs/react-dom.development.js:6355 6352 | var unmaskedContext = getUnmaskedContext(workInProgress); 6353 | var needsContext = isContextConsumer(workInProgress); 6354 | var context = needsContext ? getMaskedContext(workInProgress, unmaskedContext) : emptyObject; 6355 | var instance = new ctor(props, context); 6356 | adoptClassInstance(workInProgress, instance); 6357 | 6358 | // Cache unmasked context so we can avoid recreating masked context unless necessary. View compiled updateClassComponent node_modules/react-dom/cjs/react-dom.development.js:7839 7836 | if (current === null) { 7837 | if (!workInProgress.stateNode) { 7838 | // In the initial pass we might need to construct the instance. 7839 | constructClassInstance(workInProgress, workInProgress.pendingProps); 7840 | mountClassInstance(workInProgress, renderExpirationTime); 7841 | shouldUpdate = true; 7842 | } else { View compiled beginWork node_modules/react-dom/cjs/react-dom.development.js:8225 8222 | case FunctionalComponent: 8223 | return updateFunctionalComponent(current, workInProgress); 8224 | case ClassComponent: 8225 | return updateClassComponent(current, workInProgress, renderExpirationTime); 8226 | case HostRoot: 8227 | return updateHostRoot(current, workInProgress, renderExpirationTime); 8228 | case HostComponent: View compiled performUnitOfWork node_modules/react-dom/cjs/react-dom.development.js:10224 10221 | ReactDebugCurrentFiber.setCurrentFiber(workInProgress); 10222 | } 10223 | 10224 | var next = beginWork(current, workInProgress, nextRenderExpirationTime); 10225 | { 10226 | ReactDebugCurrentFiber.resetCurrentFiber(); 10227 | } View compiled workLoop node_modules/react-dom/cjs/react-dom.development.js:10288 10285 | if (nextRenderExpirationTime <= mostRecentCurrentTime) { 10286 | // Flush all expired work. 10287 | while (nextUnitOfWork !== null) { 10288 | nextUnitOfWork = performUnitOfWork(nextUnitOfWork); 10289 | } 10290 | } else { 10291 | // Flush asynchronous work until the deadline runs out of time. View compiled HTMLUnknownElement.callCallback node_modules/react-dom/cjs/react-dom.development.js:542 539 | // nested call would trigger the fake event handlers of any call higher 540 | // in the stack. 541 | fakeNode.removeEventListener(evtType, callCallback, false); 542 | func.apply(context, funcArgs); 543 | didError = false; 544 | } 545 | View compiled invokeGuardedCallbackDev node_modules/react-dom/cjs/react-dom.development.js:581 578 | // errors, it will trigger our global error handler. 579 | var evt = document.createEvent('Event'); 580 | evt.initEvent(evtType, false, false); 581 | fakeNode.dispatchEvent(evt); 582 | 583 | if (didError) { 584 | if (!didSetError) { View compiled invokeGuardedCallback node_modules/react-dom/cjs/react-dom.development.js:438 435 | @param {...} args Arguments for function 436 | */ 437 | invokeGuardedCallback: function (name, func, context, a, b, c, d, e, f) { 438 | invokeGuardedCallback.apply(ReactErrorUtils, arguments); 439 | }, 440 | 441 | /* View compiled renderRoot node_modules/react-dom/cjs/react-dom.development.js:10366 10363 | var didError = false; 10364 | var error = null; 10365 | { 10366 | invokeGuardedCallback$1(null, workLoop, null, expirationTime); 10367 | if (hasCaughtError()) { 10368 | didError = true; 10369 | error = clearCaughtError(); View compiled performWorkOnRoot node_modules/react-dom/cjs/react-dom.development.js:11014 11011 | root.remainingExpirationTime = commitRoot(finishedWork); 11012 | } else { 11013 | root.finishedWork = null; 11014 | finishedWork = renderRoot(root, expirationTime); 11015 | if (finishedWork !== null) { 11016 | // We've completed the root. Commit it. 11017 | root.remainingExpirationTime = commitRoot(finishedWork); View compiled performWork node_modules/react-dom/cjs/react-dom.development.js:10967 10964 | } 10965 | 10966 | while (nextFlushedRoot !== null && nextFlushedExpirationTime !== NoWork && (minExpirationTime === NoWork || nextFlushedExpirationTime <= minExpirationTime) && !deadlineDidExpire) { 10967 | performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime); 10968 | // Find the next highest priority work. 10969 | findHighestPriorityRoot(); 10970 | } View compiled requestWork node_modules/react-dom/cjs/react-dom.development.js:10878 10875 | 10876 | // TODO: Get rid of Sync and use current time? 10877 | if (expirationTime === Sync) { 10878 | performWork(Sync, null); 10879 | } else { 10880 | scheduleCallbackWithExpiration(expirationTime); 10881 | } View compiled scheduleWorkImpl node_modules/react-dom/cjs/react-dom.development.js:10732 10729 | var root = node.stateNode; 10730 | 10731 | checkRootNeedsClearing(root, fiber, expirationTime); 10732 | requestWork(root, expirationTime); 10733 | checkRootNeedsClearing(root, fiber, expirationTime); 10734 | } else { 10735 | { View compiled scheduleWork node_modules/react-dom/cjs/react-dom.development.js:10689 10686 | } 10687 | 10688 | function scheduleWork(fiber, expirationTime) { 10689 | return scheduleWorkImpl(fiber, expirationTime, false); 10690 | } 10691 | 10692 | function checkRootNeedsClearing(root, fiber, expirationTime) { View compiled enqueueSetState node_modules/react-dom/cjs/react-dom.development.js:6212 6209 | next: null 6210 | }; 6211 | insertUpdateIntoFiber(fiber, update); 6212 | scheduleWork(fiber, expirationTime); 6213 | }, 6214 | enqueueReplaceState: function (instance, state, callback) { 6215 | var fiber = get(instance); View compiled Connect../node_modules/react/cjs/react.development.js.Component.setState node_modules/react/cjs/react.development.js:237 234 | / 235 | Component.prototype.setState = function (partialState, callback) { 236 | !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : void 0; 237 | this.updater.enqueueSetState(this, partialState, callback, 'setState'); 238 | }; 239 | 240 | /** View compiled Connect.onStateChange node_modules/react-redux/es/components/connectAdvanced.js:205 202 | this.notifyNestedSubs(); 203 | } else { 204 | this.componentDidUpdate = this.notifyNestedSubsOnComponentDidUpdate; 205 | this.setState(dummyState); 206 | } 207 | }; 208 | View compiled dispatch node_modules/redux/es/createStore.js:173 170 | var listeners = currentListeners = nextListeners; 171 | for (var i = 0; i < listeners.length; i++) { 172 | var listener = listeners[i]; 173 | listener(); 174 | } 175 | 176 | return action; View compiled dispatch :1:38399 (anonymous function) node_modules/redux-thunk/lib/index.js:14 11 | return action(dispatch, getState, extraArgument); 12 | } 13 | 14 | return next(action); 15 | }; 16 | }; 17 | }; View compiled dispatch node_modules/redux/es/applyMiddleware.js:35 32 | var middlewareAPI = { 33 | getState: store.getState, 34 | dispatch: function dispatch(action) { 35 | return _dispatch(action); 36 | } 37 | }; 38 | chain = middlewares.map(function (middleware) { View compiled (anonymous function) src/store/actions/index.js:62 59 | if (zoom < Application.env.viewPortZoom) { 60 | dispatch(updateZoom(Application.env.viewPortZoom)); 61 | } 62 | dispatch(getSigns(results)); 63 | dispatch(updateRefreshCenter([])); 64 | dispatch(updateCenter([lng, lat])); 65 | toastr.removeByType('success'); View compiled ▶ 2 stack frames were collapsed. (anonymous function) src/store/actions/index.js:89 86 | SimsApi.fetchSigns(lat, lng, nearby, category[1], signApp.originalRadius, locationService, address, subCategory[1]) 87 | .then((response) => { 88 | if (response.status === 200 ) { 89 | dispatch(onSignsPresent(response.data.features, zoom, lat, lng, category[0])) 90 | } else { 91 | toastr.success('No Results found') 92 | dispatch(getSigns([])); View compiled This screen is visible only in development. It will not appear if the app crashes in production. Open your browser’s developer console to further inspect this error.
14 | this.trees = new Array(this.options.maxZoom + 1); 15 | } 16 | 17 | SuperCluster.prototype = { View compiled Function.supercluster [as default] node_modules/supercluster/index.js:9 6 | module.exports.default = supercluster; 7 | 8 | function supercluster(options) { 9 | return new SuperCluster(options); 10 | } 11 | 12 | function SuperCluster(options) { View compiled new Cluster node_modules/react-mapbox-gl/lib/cluster.js:24 21 | function Cluster() { 22 | var _this = _super !== null && _super.apply(this, arguments) || this; 23 | _this.state = { 24 | superC: supercluster_1.default({ 25 | radius: _this.props.radius, 26 | maxZoom: _this.props.maxZoom, 27 | minZoom: _this.props.minZoom, View compiled constructClassInstance node_modules/react-dom/cjs/react-dom.development.js:6355 6352 | var unmaskedContext = getUnmaskedContext(workInProgress); 6353 | var needsContext = isContextConsumer(workInProgress); 6354 | var context = needsContext ? getMaskedContext(workInProgress, unmaskedContext) : emptyObject; 6355 | var instance = new ctor(props, context); 6356 | adoptClassInstance(workInProgress, instance); 6357 | 6358 | // Cache unmasked context so we can avoid recreating masked context unless necessary. View compiled updateClassComponent node_modules/react-dom/cjs/react-dom.development.js:7839 7836 | if (current === null) { 7837 | if (!workInProgress.stateNode) { 7838 | // In the initial pass we might need to construct the instance. 7839 | constructClassInstance(workInProgress, workInProgress.pendingProps); 7840 | mountClassInstance(workInProgress, renderExpirationTime); 7841 | shouldUpdate = true; 7842 | } else { View compiled beginWork node_modules/react-dom/cjs/react-dom.development.js:8225 8222 | case FunctionalComponent: 8223 | return updateFunctionalComponent(current, workInProgress); 8224 | case ClassComponent: 8225 | return updateClassComponent(current, workInProgress, renderExpirationTime); 8226 | case HostRoot: 8227 | return updateHostRoot(current, workInProgress, renderExpirationTime); 8228 | case HostComponent: View compiled performUnitOfWork node_modules/react-dom/cjs/react-dom.development.js:10224 10221 | ReactDebugCurrentFiber.setCurrentFiber(workInProgress); 10222 | } 10223 | 10224 | var next = beginWork(current, workInProgress, nextRenderExpirationTime); 10225 | { 10226 | ReactDebugCurrentFiber.resetCurrentFiber(); 10227 | } View compiled workLoop node_modules/react-dom/cjs/react-dom.development.js:10288 10285 | if (nextRenderExpirationTime <= mostRecentCurrentTime) { 10286 | // Flush all expired work. 10287 | while (nextUnitOfWork !== null) { 10288 | nextUnitOfWork = performUnitOfWork(nextUnitOfWork); 10289 | } 10290 | } else { 10291 | // Flush asynchronous work until the deadline runs out of time. View compiled HTMLUnknownElement.callCallback node_modules/react-dom/cjs/react-dom.development.js:542 539 | // nested call would trigger the fake event handlers of any call higher 540 | // in the stack. 541 | fakeNode.removeEventListener(evtType, callCallback, false); 542 | func.apply(context, funcArgs); 543 | didError = false; 544 | } 545 | View compiled invokeGuardedCallbackDev node_modules/react-dom/cjs/react-dom.development.js:581 578 | // errors, it will trigger our global error handler. 579 | var evt = document.createEvent('Event'); 580 | evt.initEvent(evtType, false, false); 581 | fakeNode.dispatchEvent(evt); 582 | 583 | if (didError) { 584 | if (!didSetError) { View compiled invokeGuardedCallback node_modules/react-dom/cjs/react-dom.development.js:438 435 | @param {...} args Arguments for function 436 | */ 437 | invokeGuardedCallback: function (name, func, context, a, b, c, d, e, f) { 438 | invokeGuardedCallback.apply(ReactErrorUtils, arguments); 439 | }, 440 | 441 | /* View compiled renderRoot node_modules/react-dom/cjs/react-dom.development.js:10366 10363 | var didError = false; 10364 | var error = null; 10365 | { 10366 | invokeGuardedCallback$1(null, workLoop, null, expirationTime); 10367 | if (hasCaughtError()) { 10368 | didError = true; 10369 | error = clearCaughtError(); View compiled performWorkOnRoot node_modules/react-dom/cjs/react-dom.development.js:11014 11011 | root.remainingExpirationTime = commitRoot(finishedWork); 11012 | } else { 11013 | root.finishedWork = null; 11014 | finishedWork = renderRoot(root, expirationTime); 11015 | if (finishedWork !== null) { 11016 | // We've completed the root. Commit it. 11017 | root.remainingExpirationTime = commitRoot(finishedWork); View compiled performWork node_modules/react-dom/cjs/react-dom.development.js:10967 10964 | } 10965 | 10966 | while (nextFlushedRoot !== null && nextFlushedExpirationTime !== NoWork && (minExpirationTime === NoWork || nextFlushedExpirationTime <= minExpirationTime) && !deadlineDidExpire) { 10967 | performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime); 10968 | // Find the next highest priority work. 10969 | findHighestPriorityRoot(); 10970 | } View compiled requestWork node_modules/react-dom/cjs/react-dom.development.js:10878 10875 | 10876 | // TODO: Get rid of Sync and use current time? 10877 | if (expirationTime === Sync) { 10878 | performWork(Sync, null); 10879 | } else { 10880 | scheduleCallbackWithExpiration(expirationTime); 10881 | } View compiled scheduleWorkImpl node_modules/react-dom/cjs/react-dom.development.js:10732 10729 | var root = node.stateNode; 10730 | 10731 | checkRootNeedsClearing(root, fiber, expirationTime); 10732 | requestWork(root, expirationTime); 10733 | checkRootNeedsClearing(root, fiber, expirationTime); 10734 | } else { 10735 | { View compiled scheduleWork node_modules/react-dom/cjs/react-dom.development.js:10689 10686 | } 10687 | 10688 | function scheduleWork(fiber, expirationTime) { 10689 | return scheduleWorkImpl(fiber, expirationTime, false); 10690 | } 10691 | 10692 | function checkRootNeedsClearing(root, fiber, expirationTime) { View compiled enqueueSetState node_modules/react-dom/cjs/react-dom.development.js:6212 6209 | next: null 6210 | }; 6211 | insertUpdateIntoFiber(fiber, update); 6212 | scheduleWork(fiber, expirationTime); 6213 | }, 6214 | enqueueReplaceState: function (instance, state, callback) { 6215 | var fiber = get(instance); View compiled Connect../node_modules/react/cjs/react.development.js.Component.setState node_modules/react/cjs/react.development.js:237 234 | / 235 | Component.prototype.setState = function (partialState, callback) { 236 | !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : void 0; 237 | this.updater.enqueueSetState(this, partialState, callback, 'setState'); 238 | }; 239 | 240 | /** View compiled Connect.onStateChange node_modules/react-redux/es/components/connectAdvanced.js:205 202 | this.notifyNestedSubs(); 203 | } else { 204 | this.componentDidUpdate = this.notifyNestedSubsOnComponentDidUpdate; 205 | this.setState(dummyState); 206 | } 207 | }; 208 | View compiled dispatch node_modules/redux/es/createStore.js:173 170 | var listeners = currentListeners = nextListeners; 171 | for (var i = 0; i < listeners.length; i++) { 172 | var listener = listeners[i]; 173 | listener(); 174 | } 175 | 176 | return action; View compiled dispatch
Seems like a problem in the documentaion of the supercluster library. Implicitly, this line treats maxZoom as an integer
maxZoom
RangeError: Invalid array length new SuperCluster node_modules/supercluster/index.js:14 11 | 12 | function SuperCluster(options) { 13 | this.options = extend(Object.create(this.options), options);