StevenM
September 23, 2020, 4:23am
1
I have created a partial which is top menu.
All good and viewing the partial in Wappler is as expected when looking at the partial file I created in the Project folder on the left.
I add the partial to the page and it does not show in Wappler and when viewing in the Browser I get a 500 Error?
Tried restarting and still same error.
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
I take the partial out and no 500 error.
Are partials supported in node projects this way?
Tried moving the partial include and still no joy.
Teodor
September 23, 2020, 4:57am
2
Can you share a screenshot of your browser when you see this error?
StevenM
September 23, 2020, 5:34am
4
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.
Teodor
September 23, 2020, 5:53am
5
Do you have any server action included on the page? If yes, please enable the debug option in server connect settings.
StevenM
September 23, 2020, 6:02am
6
No server actions in the page.
Just basic show and hide variable and class toggle.
With debug on same 500 error
Teodor
September 23, 2020, 6:15am
7
What’s the partial content? What’s the layout page content?
StevenM
September 23, 2020, 6:29am
8
OK do you wont me to send you the files?
One is nav menu top the other is a large multi step form.
StevenM
September 23, 2020, 6:31am
9
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
StevenM
September 23, 2020, 6:42am
10
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?
Teodor
September 23, 2020, 6:58am
15
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.
StevenM
September 23, 2020, 7:02am
16
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!
StevenM
September 23, 2020, 7:05am
17
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.
1 Like
Teodor
September 23, 2020, 7:07am
18
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.
1 Like
Teodor
September 23, 2020, 7:26am
21
As a temporary fix you can edit the partial path and add /
in front of it like:
<%- await include('/partials/partial1', Object.assign({}, locals, )) %>
StevenM
September 23, 2020, 11:44pm
22
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, )) %>
George
Split this topic
October 17, 2020, 12:16pm
24
2 posts were split to a new topic: Error with partial in NodeJS
George
October 17, 2020, 12:18pm
25
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.