Click here to Skip to main content
15,946,529 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Error: The partial main could not be found
    at Object.invokePartial


What I have tried:

The file is in the right place, so I tried to reinstate the file in my command terminal, using Windows PowerShell.
Posted
Updated 13-Sep-23 7:42am
v2
Comments
Richard MacCutchan 29-Aug-23 4:07am    
You need to show the code that produces the error. No one here can guess what your code looks like.

1 solution

Sounds like you're using handlebar here. In your app.engine call, you have the option to define a partialsDir like this
TypeScript
app.engine('hbs', hbs({
  // other settings here
  partialsDir  : [
    path.join(__dirname, 'views/partials'),
  ]
})
);
Move your partial files to that folder. Don't forget that the extension for your partial has to match the extension specified in this set up. The commonest one to use is .hbs.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900