mauricerenck / indieConnector

A Kirby Webmention Plugin
MIT License
27 stars 3 forks source link

The $view could not be loaded #1

Closed MaluNoPeleke closed 2 years ago

MaluNoPeleke commented 2 years ago

After installing the plugin (1.2.1) I get an error "The $view could not be loaded" when trying to accessing the panel page:

Error: The $view could not be loaded at Object.request (index.js:1) at async Object.go (index.js:1) error @ index.js:1 (anonymous) @ vendor.js:6 _s.dispatch @ vendor.js:12 dispatch @ vendor.js:6 window.onunhandledrejection @ index.js:1

index.js:1 GET https://dev.domain.tld/panel/webmentions?language=de 500 request @ index.js:1 go @ index.js:1 t.$go.window.panel.$go @ index.js:1 onClick @ index.js:1 Vt @ vendor.js:6 n @ vendor.js:6 i._wrapper @ vendor.js:6 index.js:1 Error: The $view could not be loaded at Object.request (index.js:1) at async Object.go (index.js:1) error @ index.js:1 (anonymous) @ vendor.js:6 _s.dispatch @ vendor.js:12 dispatch @ vendor.js:6 window.onunhandledrejection @ index.js:1

mauricerenck commented 2 years ago

Okay, I guess I have to hire you for the QA position! ;)

I would guess there may be something wrong with the database. Is the file .sqlite file created?

MaluNoPeleke commented 2 years ago

I am just migrating my personal blog from Ghost CMS to Kirby CMS to learn something new and to have more flexibility and as I have not a lot of experience and I am also not a developer I maybe do things differently than it was thought of by developers ;)

I cannot find any .sqlite file. Should it be in the root directory or somewhere else?

mauricerenck commented 2 years ago

That's a good approach to learn something new, I appreciate your feedback :)

Have a look here: https://github.com/mauricerenck/indieConnector/blob/main/docs/setup.md In order to use the panel view, you have to enable stats and set a path for the database file. This could be in .sqilte as suggested or in your content folder. The important part is: this folder has to exist as the plugin won't create it and then will fail writing the file.

I am working on a solution to somehow give more useful feedback in the panel. But currently if something in the php part of the plugin throws an error, kirby will show the view error you've seen. You could look into the browser console and should see a request that failed with some error message in the response.

MaluNoPeleke commented 2 years ago

If have set that already to this in the config

    'mauricerenck.indieConnector.stats' => true,
    'mauricerenck.indieConnector.sqlitePath' => '.logs/',

but I still get the error (the subfolder "logs" exists and contains already some other files) and sqlite is supported by my hoster. Is there any other way to debug it further?

image

btw: If I go to https://webmention.io/settings/webhooks there is nothing where I could enter the IndieConnector endpoint and also opening manually https://your-url.tld/indieConnector/webhook/webmentionio (of course with the correct domain.tld) is showing me an error 404.

mauricerenck commented 2 years ago

You should be able to set the endpoint and secret here: https://webmention.io/settings/webhooks

The error 404 ist correct. The enpoint is a POST endpoint, which means you cannot open it directly in the browser (which is a GET call), you have to use a POST-Call (like when sending a form) for that. Also some header information has to be included when calling the endpoint, otherwise it will return the 404 error.

If you have access you could have a look at the error or access logs of your hosting package. This might include further details on why the error occures. Did you enable debug mode for kirby?

MaluNoPeleke commented 2 years ago

Maybe my first webmention is missing. Could you do me a favor and try it out here? https://www.peleke.de/de/blog/umstieg-von-ghost-cms-auf-kirby-cms

mauricerenck commented 2 years ago

I tried to send a webmention via curl, let me know if something arrived on your end. Also please update to the latest version, where I fixed a nasty bug.

If you look into the .logs folder, is there a indieConnector.sqlite file?

MaluNoPeleke commented 2 years ago

Thanks, but I cannot see anything. These are the only mentions I received so far but they don't show up (only visible via webmention.io): image There is also no indieConnector.sqlite file created, only a simplestats.sqlite (from the SimpleStats plugin). Is something wrong with the config?

'mauricerenck.indieConnector.sqlitePath' => '.logs/'

image

EDIT: I fixed the problem with the sqlite file by changing the path to this in the config:

'mauricerenck.indieConnector.sqlitePath' => 'site/logs/',

But I still cannot see any webmentions listed in the panel or the frontend page. Can you please send one again? Theoretically it should also work if you react here, correct? https://twitter.com/MaluNoPeleke/status/1471875756477267979

mauricerenck commented 2 years ago

I just liked you post, if you have the latest version of the indieConnector it should be visible in the backend. Please be aware that the plugin currently only works with webmention.io webhooks, so only new webmentions will be shown in the stats, no webmentions existing before. I plan to implement an additional way to retreive webmentions, then it will be possible to also get older ones.

MaluNoPeleke commented 2 years ago

Thanks a lot, it works 🙂