MODX endless saving SyntaxError: expected expression, got '<'












0















I have to deal with MODX Revolution, when I edit any page and press Save, the progress bar keeps loading forever, console says SyntaxError: expected expression, got '<' ext-all.js:21



Tried to disable all extensions in package manager



Tested on Chrome 59 and Firefox 54



MODX Revolution 2.5.2-pl



Ext JS 3.4



IIS 8










share|improve this question

























  • You should inspect your page with FireBug or similar. You'll probably find that is being generated incorrectly.

    – Haskell McRavin
    Jun 27 '17 at 4:05






  • 1





    "Syntax error at '<'" usually means that the response returned from the server is HTML (e.g. an error page), not JSON (the expected answer).

    – Alexander
    Jun 27 '17 at 12:31











  • I had this problem and It was my Chrome Extension JSON Viewer Awesome causing the issue

    – steve sonius
    Nov 16 '18 at 3:18
















0















I have to deal with MODX Revolution, when I edit any page and press Save, the progress bar keeps loading forever, console says SyntaxError: expected expression, got '<' ext-all.js:21



Tried to disable all extensions in package manager



Tested on Chrome 59 and Firefox 54



MODX Revolution 2.5.2-pl



Ext JS 3.4



IIS 8










share|improve this question

























  • You should inspect your page with FireBug or similar. You'll probably find that is being generated incorrectly.

    – Haskell McRavin
    Jun 27 '17 at 4:05






  • 1





    "Syntax error at '<'" usually means that the response returned from the server is HTML (e.g. an error page), not JSON (the expected answer).

    – Alexander
    Jun 27 '17 at 12:31











  • I had this problem and It was my Chrome Extension JSON Viewer Awesome causing the issue

    – steve sonius
    Nov 16 '18 at 3:18














0












0








0








I have to deal with MODX Revolution, when I edit any page and press Save, the progress bar keeps loading forever, console says SyntaxError: expected expression, got '<' ext-all.js:21



Tried to disable all extensions in package manager



Tested on Chrome 59 and Firefox 54



MODX Revolution 2.5.2-pl



Ext JS 3.4



IIS 8










share|improve this question
















I have to deal with MODX Revolution, when I edit any page and press Save, the progress bar keeps loading forever, console says SyntaxError: expected expression, got '<' ext-all.js:21



Tried to disable all extensions in package manager



Tested on Chrome 59 and Firefox 54



MODX Revolution 2.5.2-pl



Ext JS 3.4



IIS 8







extjs extjs3 modx






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 27 '17 at 12:32









Alexander

14.7k937100




14.7k937100










asked Jun 27 '17 at 4:01









plavozontplavozont

416410




416410













  • You should inspect your page with FireBug or similar. You'll probably find that is being generated incorrectly.

    – Haskell McRavin
    Jun 27 '17 at 4:05






  • 1





    "Syntax error at '<'" usually means that the response returned from the server is HTML (e.g. an error page), not JSON (the expected answer).

    – Alexander
    Jun 27 '17 at 12:31











  • I had this problem and It was my Chrome Extension JSON Viewer Awesome causing the issue

    – steve sonius
    Nov 16 '18 at 3:18



















  • You should inspect your page with FireBug or similar. You'll probably find that is being generated incorrectly.

    – Haskell McRavin
    Jun 27 '17 at 4:05






  • 1





    "Syntax error at '<'" usually means that the response returned from the server is HTML (e.g. an error page), not JSON (the expected answer).

    – Alexander
    Jun 27 '17 at 12:31











  • I had this problem and It was my Chrome Extension JSON Viewer Awesome causing the issue

    – steve sonius
    Nov 16 '18 at 3:18

















You should inspect your page with FireBug or similar. You'll probably find that is being generated incorrectly.

– Haskell McRavin
Jun 27 '17 at 4:05





You should inspect your page with FireBug or similar. You'll probably find that is being generated incorrectly.

– Haskell McRavin
Jun 27 '17 at 4:05




1




1





"Syntax error at '<'" usually means that the response returned from the server is HTML (e.g. an error page), not JSON (the expected answer).

– Alexander
Jun 27 '17 at 12:31





"Syntax error at '<'" usually means that the response returned from the server is HTML (e.g. an error page), not JSON (the expected answer).

– Alexander
Jun 27 '17 at 12:31













I had this problem and It was my Chrome Extension JSON Viewer Awesome causing the issue

– steve sonius
Nov 16 '18 at 3:18





I had this problem and It was my Chrome Extension JSON Viewer Awesome causing the issue

– steve sonius
Nov 16 '18 at 3:18












1 Answer
1






active

oldest

votes


















0














OK, I solved this. In Chrome console I used beautifier to beautify ext-all.js. Then I replaced compressed javascript with beautified one. After a bit of debugging I've found this piece of code:



try {
A = r.contentWindow.document || r.contentDocument || g.frames[l].document;
if (A) {
if (A.body) {
if (/textarea/i.test((z = A.body.firstChild || {}).tagName)) {
w.responseText = z.value
} else {
w.responseText = A.body.innerHTML
}
}
w.responseXML = A.XMLDocument || A
}
}


The problem was that A.body.innerHTML returned JSON wrapped with "pre" tag. I didn't want to dig further into this, so just added



w.responseText = w.responseText.match(/{.*}/)[0]


This should be fixed by extjs or modix team I guess...






share|improve this answer
























  • This is not a proper fix. The problem is that an AJAX request (which the manager uses a lot) returned HTML, instead of JSON. It typically does that when there's an uncaught PHP error of sorts. Inspecting the outgoing AJAX requests and their responses is how you would find out the actual problem, so you can apply a targeted fix for that.

    – Mark Hamstra
    Aug 9 '17 at 16:20











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f44772071%2fmodx-endless-saving-syntaxerror-expected-expression-got%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














OK, I solved this. In Chrome console I used beautifier to beautify ext-all.js. Then I replaced compressed javascript with beautified one. After a bit of debugging I've found this piece of code:



try {
A = r.contentWindow.document || r.contentDocument || g.frames[l].document;
if (A) {
if (A.body) {
if (/textarea/i.test((z = A.body.firstChild || {}).tagName)) {
w.responseText = z.value
} else {
w.responseText = A.body.innerHTML
}
}
w.responseXML = A.XMLDocument || A
}
}


The problem was that A.body.innerHTML returned JSON wrapped with "pre" tag. I didn't want to dig further into this, so just added



w.responseText = w.responseText.match(/{.*}/)[0]


This should be fixed by extjs or modix team I guess...






share|improve this answer
























  • This is not a proper fix. The problem is that an AJAX request (which the manager uses a lot) returned HTML, instead of JSON. It typically does that when there's an uncaught PHP error of sorts. Inspecting the outgoing AJAX requests and their responses is how you would find out the actual problem, so you can apply a targeted fix for that.

    – Mark Hamstra
    Aug 9 '17 at 16:20
















0














OK, I solved this. In Chrome console I used beautifier to beautify ext-all.js. Then I replaced compressed javascript with beautified one. After a bit of debugging I've found this piece of code:



try {
A = r.contentWindow.document || r.contentDocument || g.frames[l].document;
if (A) {
if (A.body) {
if (/textarea/i.test((z = A.body.firstChild || {}).tagName)) {
w.responseText = z.value
} else {
w.responseText = A.body.innerHTML
}
}
w.responseXML = A.XMLDocument || A
}
}


The problem was that A.body.innerHTML returned JSON wrapped with "pre" tag. I didn't want to dig further into this, so just added



w.responseText = w.responseText.match(/{.*}/)[0]


This should be fixed by extjs or modix team I guess...






share|improve this answer
























  • This is not a proper fix. The problem is that an AJAX request (which the manager uses a lot) returned HTML, instead of JSON. It typically does that when there's an uncaught PHP error of sorts. Inspecting the outgoing AJAX requests and their responses is how you would find out the actual problem, so you can apply a targeted fix for that.

    – Mark Hamstra
    Aug 9 '17 at 16:20














0












0








0







OK, I solved this. In Chrome console I used beautifier to beautify ext-all.js. Then I replaced compressed javascript with beautified one. After a bit of debugging I've found this piece of code:



try {
A = r.contentWindow.document || r.contentDocument || g.frames[l].document;
if (A) {
if (A.body) {
if (/textarea/i.test((z = A.body.firstChild || {}).tagName)) {
w.responseText = z.value
} else {
w.responseText = A.body.innerHTML
}
}
w.responseXML = A.XMLDocument || A
}
}


The problem was that A.body.innerHTML returned JSON wrapped with "pre" tag. I didn't want to dig further into this, so just added



w.responseText = w.responseText.match(/{.*}/)[0]


This should be fixed by extjs or modix team I guess...






share|improve this answer













OK, I solved this. In Chrome console I used beautifier to beautify ext-all.js. Then I replaced compressed javascript with beautified one. After a bit of debugging I've found this piece of code:



try {
A = r.contentWindow.document || r.contentDocument || g.frames[l].document;
if (A) {
if (A.body) {
if (/textarea/i.test((z = A.body.firstChild || {}).tagName)) {
w.responseText = z.value
} else {
w.responseText = A.body.innerHTML
}
}
w.responseXML = A.XMLDocument || A
}
}


The problem was that A.body.innerHTML returned JSON wrapped with "pre" tag. I didn't want to dig further into this, so just added



w.responseText = w.responseText.match(/{.*}/)[0]


This should be fixed by extjs or modix team I guess...







share|improve this answer












share|improve this answer



share|improve this answer










answered Jun 28 '17 at 1:55









plavozontplavozont

416410




416410













  • This is not a proper fix. The problem is that an AJAX request (which the manager uses a lot) returned HTML, instead of JSON. It typically does that when there's an uncaught PHP error of sorts. Inspecting the outgoing AJAX requests and their responses is how you would find out the actual problem, so you can apply a targeted fix for that.

    – Mark Hamstra
    Aug 9 '17 at 16:20



















  • This is not a proper fix. The problem is that an AJAX request (which the manager uses a lot) returned HTML, instead of JSON. It typically does that when there's an uncaught PHP error of sorts. Inspecting the outgoing AJAX requests and their responses is how you would find out the actual problem, so you can apply a targeted fix for that.

    – Mark Hamstra
    Aug 9 '17 at 16:20

















This is not a proper fix. The problem is that an AJAX request (which the manager uses a lot) returned HTML, instead of JSON. It typically does that when there's an uncaught PHP error of sorts. Inspecting the outgoing AJAX requests and their responses is how you would find out the actual problem, so you can apply a targeted fix for that.

– Mark Hamstra
Aug 9 '17 at 16:20





This is not a proper fix. The problem is that an AJAX request (which the manager uses a lot) returned HTML, instead of JSON. It typically does that when there's an uncaught PHP error of sorts. Inspecting the outgoing AJAX requests and their responses is how you would find out the actual problem, so you can apply a targeted fix for that.

– Mark Hamstra
Aug 9 '17 at 16:20


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f44772071%2fmodx-endless-saving-syntaxerror-expected-expression-got%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

Xamarin.form Move up view when keyboard appear

Post-Redirect-Get with Spring WebFlux and Thymeleaf

Anylogic : not able to use stopDelay()