store.js icon indicating copy to clipboard operation
store.js copied to clipboard

IE11 isFunction exception when loading plugins

Open mikelovesrobots opened this issue 8 years ago • 1 comments

Hey there,

I appreciate your work on the library!

When running on IE11 (not edge) and requiring('store'), I'm seeing exceptions in store-engine.js when loading plugins.

		// Check that the plugin is properly formed
		if (!isFunction(plugin)) {
			throw new Error('Plugins must be function values that return objects')
		}

Hovering over plugin in the debugger reveals that it's "function json2plugin(), which sounds good, could really be a function. But when I step into isFunction` (in util.js):

function isFunction(val) {
	return val && {}.toString.call(val) === '[object Function]'
}

I see that {}.toString.call(val) is actually returning an "[object Array iterator]" and not an [object Function]. I wonder if I need to do some sort of polyfill. But maybe that shouldn't be necessary because this is supported back to ie8, right?

Like most developers, we're running a semi-complicated mix of webpack and babel. I believe that all we're doing to the store.js library is smooshing it down into a single file along with the rest of our node_modules, but there might be more going on behind the scenes peculiar to our particular install.

Any ideas or suggestions would be welcome. Thanks!

  • Mike

mikelovesrobots avatar Sep 20 '17 19:09 mikelovesrobots

We're also running into this issue!

georgebonnr avatar Oct 09 '17 20:10 georgebonnr