yashha / wp-nuxt

NOT MAINTAINED The module adds WP-API to your nuxt application.
https://wp-nuxt.netlify.com/
MIT License
219 stars 18 forks source link

IE 11 syntax error #67

Open northosts opened 5 years ago

northosts commented 5 years ago

We have an issue when we are using wp-nuxt out of the box on ie11, we get a syntax error in the superagent library (yarn run dev -> vendor.app.js):

.forEach(fn => {

Problem is that arrow-functions (and other ES6) do not work in ie11, so we added all libraries to transpile in the build option. That solves the first error and a couple of others that are following and are ES6 related. Unfortunately, now we are stuck with the following error, which we can't find any fix for (vendor.app.js): "Unable to get property 'replace' of undefined or null reference".

namedGroupedPattern.replace(

Is there a fix for that?

yashha commented 5 years ago

Interesting, I can't get it working too, I have to investigate it more. Also I can't reproduce your new error at the moment. Which libaries did you add in the transpile option.

Seems to be an issue with wpapi. Does wuxt work in ie11 at the moment?

yashha commented 5 years ago

Maybe related to this: https://github.com/WP-API/node-wpapi/issues/438

yashha commented 5 years ago

Same errors here at @pfunto 's project using next https://github.com/prismdreamfactory/kaiyros-frontend

northosts commented 5 years ago

Yes, seems like the same errors we are experiencing. No wuxt doesn't work with ie11, which was the reason to open this issue :) Will test the workaround in the issue you referenced. We had problems to load the client bundle only in the client, but I'll give it another try.

yashha commented 5 years ago

Checkout the pr, I had also problems with the client build and did now a fork. The browser build of the alpha release is weird. It is different then what I released with the fork. https://cdn.jsdelivr.net/npm/wpapi@2.0.0-alpha.1/browser/wpapi.js https://cdn.jsdelivr.net/npm/wpapi-fork@2.0.0-alpha.1/browser/wpapi.js

defaye commented 3 years ago

Was there any advances on this issue? Any new insights on where things are at?

yashha commented 3 years ago

When you have an Idea how to solve it or want to contribute, you can open a pull request. I have no time to solve this at the moment also because ie11 is kind of outdated it is not my prio at the moment sorry.

Here was an attempt to get it working, but I think it has to be adapted and it is not a good solution. https://github.com/yashha/wp-nuxt/pull/68

Triloworld commented 2 years ago

From https://docs.microsoft.com/en-us/lifecycle/products/internet-explorer-11 After June 15, 2022 it is obsolete and will have more problems that only this library. Pleas upgrade browser or fork it and rebuild if required. I don't see any advantage in supporting it. Maybe polyfill ES6 in IE11?