The system is unable to locate the specific file or directory that is causing an error in the Pug

After deploying to Heroku, I encountered an error that was not present when running the application locally.

Here is the message displayed in the browser: https://i.stack.imgur.com/CbhaV.png

This is my display.pug file:

extends ../LoginLayout/LoginLayout.pug
block content

- var createdAt = requser.local.profile.createdAt
script(type="text/javascript").
    $(document).ready(function() {
        var createdAt = Date.parse('!{createdAt}');            
        //- console.log(createdAt);
        $('.memberSince')[0].innerHTML = moment(createdAt).fromNow(true);
    });

.parallax-container.display
    .parallax
        img(src=requser.local.profile.herobg)
    .container.white-text.center
        img.circle(src=requser.local.profile.dp style='width: 200px;')
        h1 #{requser.local.name}
        h6 Member since #[span.memberSince #{createdAt}] | Lives in #{requser.local.profile.location} | #[strong 232222] points
        a.btn.btn-large.blue.darken-3.waves-amber.waves-effect.white-text(href='#') #[i.fa.fa-user-plus.left] Follow

Answer №1

After some troubleshooting, I managed to figure out the solution on my own.

Here is my file structure:

https://i.stack.imgur.com/9veS2.png

It turns out that the issue was with the naming convention in my code. I had used

extends ../LoginLayout/LoginLayout.pug
instead of
extends ../loginLayout/loginLayout.pug
. Paying attention to the letter casing in the file path fixed the problem!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The error message "Uncaught TypeError: res.sendStatus is not a function" was encountered

I encountered a peculiar issue within my application. Upon inspecting the package.json, it reveals that the version of express is set to be greater than 4.x. { "name": "MyAPI", "version": "1.0.0", "private": true, "scripts": { "start": "node . ...

What prevents my kittens from vocalizing once I bring them back from the database?

Trying to implement the code from http://mongoosejs.com/docs/index.html, but I seem to be missing something fundamental. Why does the schema not get applied to the objects I retrieve? The Issue const mongoose = require('mongoose'); mongoose.con ...

Encountering an issue: Module not found - 'cryptile' during express js installation

Just dipping my toes into the world of Node.js and I'm encountering some obstacles when trying to install Express.js. Seeking assistance in resolving this issue and successfully setting up Express.js. https://i.stack.imgur.com/PlHiB.png Interestingl ...

What are the steps to initiate a new project using the CLI on a Linux operating system

I've got a project up and running in Vue JS with Node JS installed. Now I want to create a new project using CLI. Do I need to install another version of Node JS for this new project? ...

Retrieve specific components of objects using a GET request

When visitors land on my web app's homepage, a GET request is triggered to fetch a current list of Stadiums stored in the database through my API. However, the Stadium objects retrieved are packed with unnecessary data, particularly extensive arrays o ...

After the installation of Windows 10 and the latest version of NodeJS, Gatsby seems to be

The gatsby project I set up following the official website instructions seems to be malfunctioning. NodeJS version: v16.15.0, npm version: 8.8.0, gatsby version: 4.13.0, gatsby CLI version: 4.13.0 C:\Users\Dell\Desktop\New folder&bsol ...

Provide access to MongoDB data in a route quickly

I'm facing what appears to be a simple issue, yet struggling to locate comprehensive documentation on it. My goal is to pass JSON data from mongodb into a route for it to be accessible in my ejs template. Here is my schema: var GiveSchema = new Sc ...

Creating personalized node.js application starter scripts can be achieved by following these steps

My goal is to develop customized scripts for creating a new application similar to npx create-react-app my-app. I want the flexibility to personalize libraries and folder structure, but I'm unsure of the best approach. I've thought about two opti ...

Total number of requests made since the previous reset

I'm currently working on developing an API and I need to set up a route like api/v1/status in order to check the server status. This route should return a JSON response with the total number of requests made to the API since it became active. However, ...

The bond between TypeORM and express

I am working on establishing Many-to-One and One-to-Many relationships using TypeORM and MySQL with Express. The database consists of two tables: post and user. Each user can have multiple posts, while each post belongs to only one user. I want to utilize ...

Is there a way to reverse a string in Javascript without using any built-in functions?

I am looking for a way to reverse a string without using built-in functions like split, reverse, and join. I came across this code snippet on Stack Overflow (), but I'm having trouble understanding what the code does on the fourth line. I need more cl ...

The eternal pair, forever linked through upstart

I'm having trouble launching two forever instances simultaneously #Begin executing node@4040 and node@5050 continuously description "node@4040 node@5050" start on (local-filesystems and net-device-up IFACE=eth0) stop on shutdown script cd /va ...

Steps for installing npm on Ubuntu operating system

To set up the mocha test framework, npm is required. To install it, follow these steps: 1. sudo apt-get install npm 2. npm install -g mocha After running the first command, you may encounter the following error: user@dell:~/mochatest$ sudo apt-get in ...

Laravel VueJS Vuetable-2 without user authentication

Initially, I attempted all the solutions provided here and on other websites. What I have experimented with: Vuetable-2 not working with Laravel Passport Unable to retrieve data from using vuetable-2, in Vuejs 2 The Issue: I was working on a project (L ...

Why is it that clang is having trouble locating the napi.h header file in node-addon-api?

This is my first time attempting to create a node.js addon and I've been working for hours trying to get the node-addon-api package to function properly. However, I am facing difficulty in getting Clang to locate the napi header file. As a result, I a ...

I possess both a minimum and maximum number; how can I effectively create an array containing n random numbers within

Given a minimum number of 10.5 and a maximum number of 29.75, the task is to generate an array within these two ranges with a specific length denoted by 'n'. While the function for generating the array is provided below, it is important to calcul ...

Pass the response from a MySql query executed in ExpressJS to a basic JavaScript file that is responsible for modifying the

I am currently utilizing ExpressJS as my server and MySql as my local database. However, I am facing a challenge in retrieving data from a specific table and sending the query result to either a vanilla JS file or directly editing HTML through NodeJS. Her ...

Is there a way to display a default error image when an image is not found in cloudinary?

Is there a way to send an image that displays "Image coming soon" if the requested image is not found? In gridFS, I can check for the existence of an image and then either display the image or show an error image. Does Cloudinary have a feature where it a ...

Using React Native and Node.js to send pictures to an S3 bucket

One of the features in my application allows users to choose a profile image, which I want to upload to an s3 bucket when they save their profile information I send the image data along with JSON (containing name, email, telephone, for instance) from my a ...

Error: The variable 'path' has not been declared in the context of Express

Whenever I click a link on the page, even though it renders properly, an error occurs. ReferenceError: path is not defined at app.get (/var/www/example.com/example-domain/server.js:106:19) at Layer.handle [as handle_request] (/var/www/example.com/example- ...