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

React admin 3.0.0-beta.3 with IE11: ReferenceError: 'Proxy' is undefined #3881

Closed
panfiva opened this issue Oct 25, 2019 · 6 comments
Closed

Comments

@panfiva
Copy link

panfiva commented Oct 25, 2019

I followed user guide to create a sample application (https://github.com/marmelab/react-admin/blob/next/docs/Tutorial.md). To enable IE support, I added the following statements into src\index.js:

import 'react-app-polyfill/ie11'
import 'react-app-polyfill/stable';

When accessing an application, I see menu and navbar rendering properly, however instead of data table, I see an error message "Something went wrong" with the following details (see screen print; source code is also attached). Is there a way to enable IE support in v3?

==================
ReferenceError: 'Proxy' is undefined

in List (at users.js:6)
in UserList (created by WithPermissions)
in WithPermissions (created by Context.Consumer)
in Route (created by ResourceRoutes)
in Switch (created by ResourceRoutes)
in ResourceRoutes (created by Resource)
in Resource (at App.js:10)
in Route (created by RoutesWithLayout)
in Switch (created by RoutesWithLayout)
in RoutesWithLayout (created by Context.Consumer)
in div (created by Layout)
in main (created by Layout)
in div (created by Layout)
in div (created by Layout)
in Layout (created by WithStyles(Layout))
in WithStyles(Layout) (created by Context.Consumer)
in withRouter(WithStyles(Layout)) (created by ConnectFunction)
in ConnectFunction (created by LayoutWithTheme)
in ThemeProvider (created by LayoutWithTheme)
in LayoutWithTheme (created by Context.Consumer)
in Route (created by CoreAdminRouter)
in Switch (created by CoreAdminRouter)
in div (created by CoreAdminRouter)
in CoreAdminRouter (created by Context.Consumer)
in Route (created by CoreAdmin)
in Switch (created by CoreAdmin)
in Router (created by ConnectedRouter)
in ConnectedRouter (created by Context.Consumer)
in ConnectedRouterWithContext (created by ConnectFunction)
in ConnectFunction (created by CoreAdmin)
in TranslationProvider (created by CoreAdmin)
in Provider (created by CoreAdmin)
in CoreAdmin (at App.js:9)
in App (at src/index.js:14)

=================================

image

Attached source code

react-admin-app-3.zip

@fzaninotto
Copy link
Member

Confirmed. Proxy isn't supported by IE 11

image

We must document that IE11 support requires adding a polyfill, like https://github.com/GoogleChrome/proxy-polyfill

@panfiva
Copy link
Author

panfiva commented Oct 28, 2019

I tried making it work with proxy-polyfill but did not have much luck, can step-by-step instructions can be added? thanks

@fzaninotto
Copy link
Member

Sorry, I don't have an IE11 nearby. Does https://github.com/GoogleChrome/proxy-polyfill/pull/58/files help?

@fzaninotto
Copy link
Member

I didn't manage to properly configure the example to compile for IE11, so we'll leave it to the community to help debug this one.

I think the Google Proxy polyfill is the solution, but I don't know the right syntax (their doc is outdated) between

import 'proxy-polyfill/proxy.min.js';

and

const ProxyFactory = require('proxy-polyfill/proxy.min.js');
const PProxy = ProxyFactory();

@m4theushw
Copy link
Contributor

I managed to run the demo on IE11 by including the following polyfills in examples/demo/src/index.js:

import 'react-app-polyfill/ie11';
import 'react-app-polyfill/stable';
import 'proxy-polyfill';

ie11

PR #4007 adds these changes to the demo, feel free to change or close it.

@fzaninotto
Copy link
Member

Fixed by #4007.

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

No branches or pull requests

3 participants