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
js Files not loaded #13
Comments
I can not replicate this. As can be seen in line
|
You are right, I had an issue with the js pipeline. So for example this relative link works: On your demo page the paths look similar for these two files. |
Yes, these URL's are relative to the webroot of your site. It appears you've installed Grav in the webroot. The demo is installed in a subdirectory ( When the page has been created and is sent to the browser the file Being in a subdirectory or not does not make a difference to the plugin. You can check it's working by visiting https://omgevingsverkenner.nl/typography. I've temporarily copied the entire demo into the root of that domain. Since you mentioned you had an issue with the JS pipeline I wonder what special setup you're using or building. With Grav's out of the box JS pipeline it simply works. |
Thanks a lot for the explanations. I will try to debug this further. Somehow the editable-contenttools-api URL is not handled properly, or maybe not intercepted by the plugin. |
When enabling the JavaScript pipeline Grav will try to include the file |
For a quick&dirty debug, in the php file inside the function onPagesInitialized()
I have added this line: $this->grav['log']->debug('Paths: ' . json_encode($paths) . json_encode($this->grav['uri']));
Now, if I open my page in the browser, the only log entry i get is: If I open directly https://myDomain.com/editable-contenttools-api/editor.js I also do get this log entry from the php file every minute: |
Are you having this with the JavaScript pipeline enabled or disabled? |
I disabled it, since otherwise I wouldn't have the editor.js in the html page. |
As a test, could you please change The function |
If I use |
Can you look in your PHP access log file? It's interesting to see what on the PHP level is requested and results in the 404 error response. |
I am using nginx. Here is what I see in its log: 2022/04/22 18:12:16 [error] 18479#18479: *8 open() "/var/www/grav/editable-contenttools-api/editor.js" failed (2: No such file or directory), client: 172.17.26.9, server: 02ab642c8c9d, request: "GET /editable-contenttools-api/editor.js HTTP/1.1", host: "myDomain.com", referrer: "https://myDomain.com/" |
Perhaps NGINX expects a physical file while it actually is a virtual one. I have no experience with NGINX what so ever. |
One last thing that crossed my mind: are you using the Grav nginx configuration? See the section about nginx in the Grav documentation. In the default Grav I don't know whether or not this helps. Perhaps you could try with Apache? |
Thanks, I will investigate this further end of next week. |
No. I was waiting for @alangner for results of his investigations. |
Unfortunately I gave up at some point and didn't continue to use this plugin. |
I guess I'll keep looking to see if I can figure out whats wrong. I was really hoping to use this plugin |
Is there any process figuring out why this wasn't working? |
Today I have installed the plugin on localhost (Windows + XAMPP) running PHP 8.1.10 and on a Debian GNU/Linux 10 (buster) Linux system running PHP 8.1.12 as well. Both systems use Apache and have Grav v1.7.42.3 installed. After installation the plugin runs fine without any other configuration. So I am sorry but I simply can't reproduce your issue. |
This issues seems to be very odd. I am running the Linuxserver container image with the following docker compose:
I don't see anything in the logs but it seems that that script doesn't exist. Perhaps I need to try running it on bare metal to see if that fixes the issue. Update: |
So I got Grav and this plugin working in a Debian VM with PHP 8.2.7 and nginx 1.22.1. This makes me think it is either the container breaking things or the newer php version |
This weekend I tried to install nginx on localhost which went OK. However I couldn't get Grav running on it. Regarding the PHP version, I've just tried the plugin using PHP 8.2.7 and 8.2.10 on my Debian GNU/Linux 10 server without any problems. |
I am going to test setting it up on an Alpine Install to see if I can reproduce the issue outside of the container. This may be related to the linux server container config |
I couldn't get grav to run on Alpine linux and I am unfortunately giving up on this plugin. If someone is reading this in the future feel free to jump in. |
I understand. To be honest I have no idea how many people actually use this plugin or even whether or not it is used at all. It does work as far as I am able to test it on localhost on Windows and a shared hosting account (at Alwaysdata) using Debian Linux. |
Couldn't you just leave this issue open without activity? I don't see any problem with letting it go stale. |
I am reopening this issue to make it more visible though I suspect the cause lies in the server hosting Grav. So one might say it is some kind of incompatibility. Grav is more focussed on Apache than Nginx and in most cases the plugin runs fine though I don't have any data to back that up. More information is needed before I can try again to replicate and look for a solution. |
Hi,
I am trying to get your plugin running, but haven't succeeded so far.
I installed it and added the [editable] shortcut to one page for testing.
What works:
Here I am puzzled why this is not the case.
I could try to add them manually, but I'm not sure if this is feasible since at least the editor.js seems to be created dynamically.
And of course something is not running as expected, as the .js files should be added automatically as well :)
The text was updated successfully, but these errors were encountered: