Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loopback / datasource-juggler browserify bundle does not work in IE11 ? #863

Closed
drywolf opened this issue Mar 2, 2016 · 3 comments
Closed
Assignees
Labels

Comments

@drywolf
Copy link

drywolf commented Mar 2, 2016

Hi,

I'm building a javascript app with loopback for the browser (using the browserify bundling). Everything works fine in Chrome/Firefox, but when I run the same code in Internet Explorer 11 (v11.103.10586.0) I hit an error in types.js at modelType.registerType() and the builtin types.

The error happens because IE11 does not seem to support the function().name attribute ?!
(see discussion here: http://stackoverflow.com/a/6903860)

At line 47 of types.js the datasource-juggler tries to access this property and it resolved to undefined in IE11. This causes other parts of code in the juggler to crash.

I tried to fix the issue by initializing the name property manually if it is not defined, then the code continues to initialize, but in the end I receive the following error:

Error while booting loopback AssertionError: must provide a valid SharedClass

This only occurs in IE though. Before I debug deeper into the issue I would like to know if those are known issues / if IE11 support is not up to date ? Is there something on the roadmap about IE11 support that I should know before I start working on a fix...

Thanks

@loay loay added the triaging label Jun 3, 2016
@loay loay self-assigned this Jun 3, 2016
@loay
Copy link
Contributor

loay commented Jun 3, 2016

Hi @drywolf
I have read that there are issues with IE11 for debugging purpose and I quote from here: https://www.npmjs.com/package/tsify

The inlined sourcemaps that Browserify generates may not be readable by IE 11 for debugging purposes. This is easy to fix by adding exorcist to your build workflow after Browserify.

I am not sure if that is applicable to your case or that's different but thought that might help. AFAIT, there is not anything about IE11 support but I will keep you posted if I get some news.

@loay loay closed this as completed Jun 3, 2016
@peterholcomb
Copy link

@drywolf Did you ever get this resolved? I'm getting the same issue even though I've got exorcist included in the build as recommended by @loay

@drywolf
Copy link
Author

drywolf commented Sep 7, 2016

@peterholcomb I fixed this by adding a proper polyfill for function.prototype.name to my project.

The code that causes the above error is located in remote-objects.js
And as you can see the error happens also because this code depends on constructor.name returning the actual function name / class name.

You can get the polyfill that I am using from here.

PS: I did not ever need to use exorcist, the above polyfill was all I needed to fix the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants