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
Delivery API no longer compatible with create-react-app? #69
Comments
You are right.. seems like the parse5 does not publish code in ES5. The workaround I was able to get away with is to use browser umd bundle as the main entry point of delivery js sdk. Basically I went to
React build works fine with this. Do you know if there is a better way of aliasing this? Or if react has some sort of build configuration option for this? |
Imho, this sounds like something that React should address. Also, I found an issue in Parse5 library where the maintainer said that he wants to target modern code rather than ancient ES5 :-) I would still like to have a better solution for handling this other than what I mentioned above so any comments are welcomed. |
Yeah I agree with you - it should be React that resolves it, but it does look like they're recommending putting code on npm as ES5 for at least the next couple years. On the other hand, they are actively working on the 'next' release of react-scripts, currently |
@petrsvihlik, yes, it causes build to fail with |
I guess another alternative would be if it's reasonable to just leave the SDK as it is, and just add a warning/disclaimer that it should only be used with react-scripts 2.x.y. At the same time upgrade the react sample application to use 2.x.y alpha version of react-scripts. |
@liamgold yeah, I would go down this road as well. I'll likely prepare some sort of FAQ / Common issues page and try to address it there for the time being. Thank you for creating this issue and bringing this to our attention :-) |
@Enngage please do. |
I'm using ES6 + Typescript code from the beginning which I'm compiling to different formats. The problem here is with the parse5 dependency which doesn't compile its code and publishes ES6 straight I wasn't able to find any alternative to parse5 so we have to probably stick with it for now.. I do agree that the react issue is unfortunate, but essentially, react is at faults here because it tries to do the compilation for you even when it shouldn't. |
ok, i get it now, thanks :) |
FAQ page added and closing for now. I will reference the FAQ from the documentation as well. |
Was the commit intended to go to the |
Well, I'll be merging these branches (likely Today) so yeah.. There are quite a few changes in the separation itself so I will create a new branch for CM api only once the master is updated and potentially the v5 released. |
ok, thx |
Since the upgrade of Parse5 from v3 to v5 - 47417f1
create-react-app/webpack is no longer able to create a build when running yarn build:
I'm assuming this is expected since the package is now using ES6 rather than ES5?
This also happens in the sample react application: https://github.com/Kentico/cloud-sample-app-react
The text was updated successfully, but these errors were encountered: