material-table icon indicating copy to clipboard operation
material-table copied to clipboard

adding material-table package has caused IE11 to report syntax errors

Open aswamina opened this issue 7 years ago • 7 comments

I added code to use material-table. worked great on all browsers except on IE11. On IE11, when I launch my page, it reports syntax errors. screenshot 1

The way we traced this problem, is that we got to the exact commit that worked on IE11. Then the next commit was me committing the package.json with material-table dependency and committing my component using the material-table. Restarting the page in IE11 reports the syntax error.

Can you help me on this problem, because there are still a lot of customers who use IE11 ?

Could it be a webpack or babel issue and if so, any help you can provide me is much appreciated.

Thanks

aswamina avatar Jan 17 '19 22:01 aswamina

I will look at this @aswamina

mbrn avatar Jan 18 '19 05:01 mbrn

Thank you so so much. Your component is amazing and fits our needs perfectly. I really appreciate if you can help me with this.

On Thu, Jan 17, 2019 at 9:09 PM Mehmet Baran [email protected] wrote:

I will look at this @aswamina https://github.com/aswamina

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mbrn/material-table/issues/167#issuecomment-455429414, or mute the thread https://github.com/notifications/unsubscribe-auth/AIva_XkEJDhYFC778UZyzdcU_DQkfNgSks5vEVb6gaJpZM4aG3m_ .

-- Anand Swaminathan

aswamina avatar Jan 18 '19 05:01 aswamina

Thank you @aswamina , I will :)

mbrn avatar Jan 18 '19 05:01 mbrn

Hi Mehmet,

I found this article : https://dev.to/errietta/-how-to-fix-your-node-dependencies-es6-causing-browser-errors-37di which is closest to the problem I described. I was wondering if this will help get closer to the dependency that material-table has in terms of the IE error. I am going to try that out today as well on my webpack.config.js.

Thanks, Anand

On Thu, Jan 17, 2019 at 9:44 PM Mehmet Baran [email protected] wrote:

Thank you @aswamina https://github.com/aswamina , I will :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mbrn/material-table/issues/167#issuecomment-455434544, or mute the thread https://github.com/notifications/unsubscribe-auth/AIva_U3dtAC5Eg_bjZLh02ss71oE-zaqks5vEV9HgaJpZM4aG3m_ .

-- Anand Swaminathan

aswamina avatar Jan 18 '19 10:01 aswamina

Hi @aswamina,

Can you explain how did you resolved this problem. I know more developers that ask for this problem.

mbrn avatar Jan 28 '19 14:01 mbrn

I was use WebStorm IDE and was adding the line "export const withStyles(styles)". When I did this, WebStorm automatically imported withStyles from "@material-ui/core/es/styles/withStyles" instead of "@material-ui/core/styles/withStyles". This happened in two files. Similarly there were two other lines where I used Typography and WebStorm automatically imported Typography from "@material-ui/core/es/.../Typography". When this happened, you get a syntax error on IE11. Tracing this took a long time because IE11 shows the syntax error pointing to the bundle in the former case and in the latter case pointing to a random line of some other file.

aswamina avatar Jan 28 '19 18:01 aswamina

My resolution to his issue was to install babel-polyfill from npm, and import it into my App.js file. Worked like a champ.

jlgreene2 avatar Jan 30 '19 14:01 jlgreene2