0

Using EE 5.2.1

I've been working with a custom module for the last few days and haven't been in the control panel so I'm not sure when this problem started but I think it has to do with me making a mistake in another module as I was working on this custom module.

The Problem: When I'm in the entry page in the control panel I'm getting a JS error that says "EE.grid is not a function".

Here's the console:

enter image description here

Or

Uncaught TypeError: EE.grid is not a function at HTMLDocument. (admin.php?/cp/publish/edit/entry/13:890) at l (jquery.js?v=1552599112:3) at Object.fireWith [as resolveWith] (jquery.js?v=1552599112:3) at Function.ready (jquery.js?v=1552599112:3) at HTMLDocument.s (jquery.js?v=1552599112:2)

Here's the error:

enter image description here

That script line is saying:

Failed to load resource: the server responded with a status of 406 (Not Acceptable)

This hasn't been a problem before so I'm assume I've done something with a module somewhere to screw it up. When I was setting up my new module I was working off several core modules as examples and it's possible I did something with one of them.

Also, I can successfully save/edit entries but things related to files seem messed up. For instance, anything related to a file has a perpetual loading function running:

enter image description here

And if I try to add a new row

enter image description here

(since the JS isn't loading) I just get the hash link and sent back to the top of the page:

enter image description here

I haven't gotten very far in this project and I can save the code I have done so it wouldn't be the end of the world to start over, but if it's possible to just reload some core module or something that could possibly fix this that would obviously be better.

  • So I just installed EE for a completely different project on a different server and on this fresh install I'm getting the same error. Is this happening to anyone else? This is going to seriously affect my ability to use EE at all and I might have to abandon all development. – Shayne Apr 25 '19 at 19:08
1

So you see the JS resource URL that is being loaded? It looks something like this:

.../admin.php?S=0&D=cp&C=javascript...

Open that link in a new tab. It is a compiled output of JS resources for the Control Panel. This JS resource is not a raw asset, it is the output of executed PHP. This means that if your CP is reporting errors or notices, they show up in your JS resource file. This means that the JS file your Control Panel is trying to load starts with a warning or error report that is not valid JavaScript, meaning your web browser can't properly use the JS resource your Control Panel needs.

So open that resource in a new tab raw, look at what the PHP error/notice is being reported, and resolve it. Don't forget to clear both local and any infrastructure cache that might exists for that URL.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.