I finally decided to give nodejs a try instead of my usual php projects and everything was going great until suddenly, the page started rendering incorrectly.
Perhaps it has something to do with this missing file “ENOENT: no such file or directory, open ‘/opt/node_app/views/vendor.ejs’\n” that I did indeed delete and I also deleted it’s route reference, but it didn’t start happening right away after I deleted it. Also, I can’t find where it’s still referencing the file in the code.
Like I said I’m new to nodejs so not sure how the references to pages, layouts etc work, nor where the routes are stored cause there doesn’t appear to be an .htaccess/routes.json file in nodejs.
@franse, you are correct, I finally found the routes.json file. It’s in a different place in nodejs than I’m used to in PHP, but everything looks fine with the routes file. I’ll try and post more when I get a chance. It was weird cause it was working fine and then suddently wasn’t.
If I look in console of the browser, I do get this error about the vendor.ejs which is true, I did delete the vendor.ejs file and the route associated with it, however, I can’t find where it’s trying to reference the file on the main.ejs file or find the “opt” folder. It’s showing that it’s after the bootstrap script at the end of the body tag, but not sure why.
Part of the console error:
'\n 339| <script src="/bootstrap/5/js/bootstrap.bundle.min.js">\n\nENOENT: no such file or directory, open ‘/opt/node_app/views/vendor.ejs’",
May I suggest you open your Wappler project in Visual Studio Code and use the search in all files functionality to search for any references to “vendor.ejs”?
Good advice, but (sorry, slightly off-topic) I’m curious: why would you switch to VSC to search? I frequently use Wappler’s built-in search facilty when looking for references to filenames/code etc. It seems to work very well and is fast. Obviously, you have to make sure the exclusions are set up as you want.
Thanks for the reply, @Apple. I have used Wappler’s search to look for references and it didn’t find any. As TomD said, Wappler’s search has been very good in the past so I assumed it could find it but it comes up with nothing.
Oh, I wasn’t familiar with Wappler search Glad it works good! I’ve been using VSCode before I’ve started using Wappler, so that’s the only reason I mentioned it
It’s a great feature. After the initial search, it’s extremely quick - it shows a collapsible list of files, relevant line numbers and clickable links:
I believe I figured it out. It was in the route.json file after all. A search for vendor.ejs didn’t work because the extension (.ejs) is not in the route file. Should have known it was somthing simple…
{
“path”: “/:url_name”,
“page”: “vendor”,
“layout”: “main”
},