Can you share a screenshot of your browser when you see this error?
I also get the same error when I create a page with a layout.
Use a layout 500 error, but don’t apply the layout works fine.
Tried restarting Wappler, the service but still the 500 error.
Do you have any server action included on the page? If yes, please enable the debug option in server connect settings.
No server actions in the page.
Just basic show and hide variable and class toggle.
With debug on same 500 error
What’s the partial content? What’s the layout page content?
OK do you wont me to send you the files?
One is nav menu top the other is a large multi step form.
I have tested the partial nav on a blank page and it works.
But it doesn’t like something in the form page, but I get no errors and only using in page variables
Ah ha!
I was able to recreate and maybe something I am missing or a bug
so the path of the test page is /admin/partialtest.ejs
Adding the partial from:
administration_side_menu
This creates a 500 error.
However If I create a page in the top level and then add the partial menu as above it works.
Either I am not allowed to do this or the partial is not working when it is added in a sub folder?
The partials must be created/saved in the Partials folder. The same way as layouts are in the layouts folder:
You can’t just store a partial in some random folder.
I didn’t and it is not the partial is in the partial folder here:
Yeah I get it can’t be in some “random” folder, maybe learning but not stupid!
So to be completely clear:
The partial is in the partial folder as shown clearly above!
The content page is is admin/mypage.ejs
The partial is added in the content page:
500 error.
Thanks for the clarification. I was able to recreate the error when the content page is in a subfolder and you add a partial to it Nice bug catch!
@george will check this and we will fix it in the next update.
As a temporary fix you can edit the partial path and add /
in front of it like:
<%- await include('/partials/partial1', Object.assign({}, locals, )) %>
Thanks @Teodor this didn’t work, but this did and likley just the file location up another level.
<%- await include('../partials/administration_top_menu', Object.assign({}, locals, )) %>
This is improved in Wappler 3.4.0 now
An absolute link to /partials is always used - so no matter where your partial is located it works.
This topic was automatically closed after 27 hours. New replies are no longer allowed.