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

Cannot load twig templates via Ajax from Firefox #741

Closed
shailpatels opened this issue Jun 2, 2020 · 1 comment
Closed

Cannot load twig templates via Ajax from Firefox #741

shailpatels opened this issue Jun 2, 2020 · 1 comment

Comments

@shailpatels
Copy link

shailpatels commented Jun 2, 2020

Latest versions of Firefox look like they need the XMLHttpRequest response type to be explicitly defined (in this case I think it should be set to "text"), otherwise, it'll think the response is XML and try to parse it which of course its not, twig.js is just pulling in text files to parse.

This causes a number of XML parsing errors whenever a Twig template get called with ajax.
image

Sample code

Twig.twig({
    id: "test",
    href: "/example.twig",
    async: true
});

var out = Twig.twig({ ref: "test"}).render({ });

Does the render function also send XMLHttpRequests ? It looks it does which is done synchronously which is deprecated and cannot have an explicit response type.

Chrome appears to be fine
Tested on Firefox 76.0.1 on MacOS & Firefox ESR Debian 10

@shailpatels
Copy link
Author

Closed via #742

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

No branches or pull requests

1 participant