Skip to main content
Filter by
Sorted by
Tagged with
-1 votes
0 answers
21 views

how to prevent duplicate keys into database with mongodb and expressjs

i am working a crude project with mongodb expressjs and pug(formerly knone as jade) i am stuck on preventing duplicate keys both on Front-end and backend. this is what i did.... let mongoose = require(...
Obi Apostle's user avatar
0 votes
0 answers
17 views

Inconsistent indentation in pug template error

in pug template i face this error ... Error: C:\nafeesData\complete web development course\Dance Website\views\home.pug:22:1 20| li #[a(href="/") Info] 21| 22| section#...
Nafees k jadoon's user avatar
-1 votes
1 answer
27 views

CRUD operation problems in NODEJS and MONGODB [closed]

How to prevent duplicate ID and email in mongodb, nodejsand expressjs. and stop registration. also prevent the user from registring twice. Iam just new in nodejs and mongodb i will appreciate if i can ...
Obi Apostle's user avatar
1 vote
0 answers
23 views

How can I use pug in angular esbuild, using @angular-builders/custom-esbuild

I am using angular 17, I use pug template, current, I use ng-cli-pug-loader to load pug. I want to transfer to esbuild, so after researching I know that esbuild can config plugin. Can I use plugin to ...
Minh Đặng's user avatar
-1 votes
1 answer
48 views

Can I use pug template with angular builder esbuild?

In angular 17, I am using "builder": "@angular-builders/custom-webpack:browser". Now I want to use esbuild buider. But my project currently use pug template alter for html. Can I ...
Minh Đặng's user avatar
1 vote
1 answer
61 views

Colon symbol in class names for tailwind break Pug files

I am creating a project in Vue where the HTML aspect of it is written in pug. When I add a tailwind class, (for example in this case I am trying to add the classes ) .w-16.md:w-32.lg:w-48 Since it is ...
Joao Moita's user avatar
0 votes
0 answers
52 views

How can I enable Intellisense support for .pug files in vscode?

My angular project use pug template, is there any way setup intellisense for pug template file? I had tried package pugjs-angular-language-service. But it didn't work, it will better if it has ...
Minh Đặng's user avatar
0 votes
2 answers
40 views

Pug can't read array, but only if iterating through it

I am working on a small Web-development project, express with pug as the view-engine, for my University-course. I wish to iterate through an array of Weather-stations, creating a route for every one, ...
Melontree productions's user avatar
1 vote
1 answer
47 views

How do I use a module rendered by the controller with a Jade/Pug template as an argument to an event handler in the Jade/Pug template

I have this module naija passed to a template from the controller like this: res.render('testing', {title:"filter setting page", nigeria:naija ...
Femi's user avatar
  • 21
0 votes
1 answer
30 views

I get null in req.body when submitting data through pug form

this is pug form which is sending data to the requested url form.form.form-user-data(action='/submit-user-data' method='POST') .form__group label.form__label(for='name') Name ...
harshit's user avatar
0 votes
0 answers
17 views

pug/uikit nav sidebar lost left padding after uikit upgrade

I forked from this https://github.com/chekromul/uikit-ecommerce-template to build a static github page. but after I upgrade uikit to latest version, the side navbar lost its left paddings. before I ...
bhw1899's user avatar
  • 87
3 votes
2 answers
77 views

What is the order loaders applying in Webpack?

I am trying to setup the loading of .pug files by Webpack depending on interim filename extension, herewith it should be default one. In my case, the files which names ends with .vue.pug must me ...
Takeshi Tokugawa YD's user avatar
1 vote
0 answers
22 views

How can I use the selected option value of a select element in Pug/Jade template

I have this select in Pug/Jade select.form-select.col-xs-12.col-sm-12(id='selState1', onClick='+setState(selState1.value)') option(value='selState1', name='selState1',id='selState1') ...
Femi's user avatar
  • 21
1 vote
0 answers
42 views

Render block content with pug doesn't work

I'm face off an issue with Pug engine template. I can't inject the content of a Pug file into my layout, nothing is render! I have a home.pug which extends layout.pug, these two files are in the same ...
EmmanuelL's user avatar
1 vote
0 answers
91 views

How to get the static folder using Pug with Vite (Vituum, vite-plugin-pug…)

I'm using Pug for the first time with Vite and the plugin @vituum/vite-plugin-pug. Here's the structure of my project: src js css static imgs image.jpg views pages index.pug I'd ...
Lucie Bachman's user avatar
1 vote
0 answers
39 views

Read JSON in Pug NodeJs

I am sending a variable in the rendering response of my index view on my website, this variable is a JSON, but I cannot read it in Pug. JSON: { "expirepass": false, "memberships&...
Francisco Castillo's user avatar
0 votes
0 answers
24 views

How to read a json with pug NodeJs?

I am sending from node to my pug template a json in the response like this: res.render("memberships", { title: "DashRoc - Membresías", settings: JSON.parse(req.session....
Francisco Castillo's user avatar
0 votes
1 answer
282 views

Vuetify v-menu color

I am trying to change the color of the dropdown background of a v-menu. Right now it is just white then in dark mode it is that dark gray. I have tried the css override using this: .v-menu__content {...
VVaFF's user avatar
  • 13
0 votes
1 answer
26 views

Is this a pug template bug or my misunderstanding of the grammar?

I have the following code: - var a = 5; - var b = 3; script if (a === 5) if (b === 2) . var x = true; include script.js I want to include the script.js file when a == 5 and if b === ...
AGamePlayer's user avatar
  • 7,636
0 votes
0 answers
15 views

Array send by post form always received as string with first element only in Node js Express with pug

enter image description here { name: 'THERAPY 1', testsuites: '65e93cc4950e6a858809348f', description: 'UPDATED The pump software shall provide the Maximum Bolus Value therapy setting value ...
Kartik Aiyar's user avatar
1 vote
1 answer
113 views

Can't escape characters in pug/jade

I'm trying to escape special characters in pug/jade but it keeps giving me errors. I tried !{}, #[] and #[!] but non of these options allow me to use "(" character. p. !{(} Edit !{>} ...
bye-csavier's user avatar
0 votes
0 answers
31 views

how to make html div displays as 3 Column in pug

i want to display .course-item as 3 Column the .course-item in inside foreach which gets data from data base to create .course-item div but it all displays as one Column.. how can i fix it this is my ...
Rami's user avatar
  • 1
0 votes
1 answer
27 views

the gulp-pug doesn't work and say unexpected token "indent"

the gulp-pug doesn't work and say unexpected token "indent" see the images below gulp code and nodejs command prompt index.pug and nodejs command prompt package.json and nodejs command ...
M39ob Elzero's user avatar
0 votes
1 answer
54 views

How do I add structured data json script to Pug JS

I am trying to add in a script of json that is structured data for SEO into my Pug JS file. I am doing it the same way I do JavaScript with type="text/javascript", but it does not compile ...
Justin's user avatar
  • 556
0 votes
1 answer
26 views

A GET request is being fired off instead of the POST Request I've explicitly mentioned in axios

This is my login.js file which is responsible for client-side logging in functionality. My backend code is working fine as evident when I hit the api endpoint in postman and get my jwt successfully. ...
Anish Jha's user avatar
1 vote
1 answer
35 views

Express using default error handling page instead of view?

I'm following this MDN Express tutorial on creating a "Local Library" app, that uses Pug (Jade) as its templating engine. In this part of the tutorial, it details creating a controller for ...
mehkij's user avatar
  • 27
0 votes
0 answers
38 views

Mongoose data not showing on the web page as expected

I am creating a web app for keeping notes using mongodb, node.js, express and pug. When I load the home page the notes are arranged in order of date created. When I click the button to arrange the ...
AllThingsShiny's user avatar
0 votes
0 answers
54 views

How to add custom arabic font for pdf in pug file in node js project

I am using wkhtmltopdf libarary to convert pug file to PDF and in pug file I have text in arabic and english but I want specific font for arabic text to show in PDF file I tried it but it is giving ...
Sohaib Ul Hassan's user avatar
0 votes
0 answers
60 views

Linting for Pug and SASS inside Svelte files

My current setup is SvelteKit with preprocessors (TypeScript, Pug & SASS). I already have eslint, pug-lint & stylelint in place, but I can't make pug-lint and stylelint work inside .svelte ...
CRIS's user avatar
  • 346
0 votes
1 answer
80 views

Unable to access a property of an object using Mongoose

Sample data: { "_id": "ObjectId_for_Site1", "name": "Site 1", "address": "123 Reeganangam", "manager": { "_id&...
Ashok Kumar Maharajan's user avatar
0 votes
1 answer
36 views

pug how to set dynamic src

script. let thisfilefullname = document.URL.substring(document.URL.lastIndexOf('/') + 1, document.URL.lastIndexOf('.')); let imgurl = './img'; if(thisfilefullname.indexOf('localhost') == -1 &...
arachacha's user avatar
0 votes
1 answer
83 views

How to pass a HTML element as an argument to a pug mixin

I'd like to pass HTML through to my mixin. Something like this: mixin complexElement .container block header block content p This is some other content in the container. ...
mic's user avatar
  • 4,445
0 votes
2 answers
63 views

How to make three texts position on top of each slots respectively?

Description I am developing a random name picker web app and I'd like to know how to make three texts positioned on top of each slot and aligned center in each slot simultaneously. The current image ...
loupdaniel's user avatar
0 votes
1 answer
95 views

express locallibrary tutorial author names missing from book list

I'm trying to build some knowledge in back end development (because I need it!) after spending a few years on front end, and after a short intro' into Basic Node and Express from the fantastic ...
Fishbite's user avatar
  • 192
0 votes
0 answers
276 views

How to integrate Vite into an existing old express app with pug templates

I have an old code that uses Express and renders HTML with pug. It uses plain js files and imports them like: script(type='text/javascript' src='js/test.js') They use jquery all around those js files. ...
H3lltronik's user avatar
0 votes
0 answers
44 views

Cant use pug module with parcel?

I am trying to rendering the content with the pug template but I cant import the pug modules into this file, i'm using parcel to bundle all the js file also. Here is the code: import html from ".....
NtotheKtotheL's user avatar
2 votes
1 answer
153 views

How can you implement new @for @if syntax introduced in Angular 17 in PUG?

I have been using PUG in my Angular application and I like the new syntax introduced in Angular 17 regarding @for and @if, replacing *ngFor and *ngIf. I wasn't sure how to implement this via PUG. ...
Jason's user avatar
  • 917
0 votes
1 answer
100 views

How do I host a website that contains PUG templates in a sub-folder instead of an index.html file in the root directory of the project folder?

I want to host my website for free but my files are in PUG and not HTML. From what I know, I need to have an index.html file that too in the root directory to be able to host the website since that ...
Arpita's user avatar
  • 1
0 votes
0 answers
38 views

Rendering a new pug template fails in ExpressJS

I'm making a sort of basic search engine and I have 2 pug template files called index.pug (the default search page) and search.pug (search results page) and an expressjs file called app.js that ...
Edward's user avatar
  • 1
0 votes
1 answer
116 views

Pug template won't render after redirecting to new url

Whenever I attempt to redirect to a new url with query params and then try to render it after, it doesn't want to render. If i take the additional query params off, the page will render just fine. ...
Priest's user avatar
  • 1
0 votes
0 answers
121 views

Pug add scripts from includes before the closing body tag

I have some pug templates, which use the include functionality. For example I have a index.pug and a detail.pug, which act as the parent layouts. body | I am the index.pug include my_partial | ...
Zeus's user avatar
  • 856
0 votes
1 answer
74 views

Cannot see anything in the console when trying to debug a login function

I am using Node.js with Express as well as Pug templates. I have a login function that is not working. I am trying to debug the code by logging the credentials (email and password) to the console. But ...
Leon's user avatar
  • 3
0 votes
0 answers
22 views

Why pug is not rendering?

these is snip shoot of the root route As you can see from the image, when ever I try to access the root which is "localhost:3000/" is not displaying anything. I don't see any errors what's ...
Filmon Tewelde's user avatar
0 votes
0 answers
52 views

How do I create an Angular Project using the CLI that uses Pug3?

I created a project using the following... ng new my-app cd my-app npx ng add ng-cli-pug-loader But I get .../my-app on branch main > npx ng add ng-cli-pug-loader npm WARN cli npm v10.2.3 does not ...
Jackie's user avatar
  • 23.2k
0 votes
0 answers
30 views

pass form value in PUG as a paramater in onclick function

I am trying to pass a value from a form to use as a parameter in a function in a onclick button. But im not sure how to get the value. This hardcoded example works: button.btn.btn-glider(onclick=...
user6086008's user avatar
0 votes
1 answer
36 views

PhpStorm navigate to style in PUG

In my project I use PUG and SCSS. When clicking a class name in PUG file I expect PhpStorm navigate me to appropriate style definition in a SCSS file. For example, in code p.text-white-75.mb-4 ...
Alexey's user avatar
  • 3,192
0 votes
0 answers
29 views

Nodejs pug form button not redirect and submit

When I fill in the information in the form in the add-product.pug file, the information should appear as a card on the home page and should be returned to the "/" directory as a redirect, ...
emir's user avatar
  • 1
0 votes
1 answer
48 views

What is wrong with the href in the pug?

/users/mihir/users/[object%20Object]/file.txt I have the following pug file and JS code to render the pug page. I have links for the directories and files in the path filepath, for which I am adding &...
Mihir Mutyampeta's user avatar
0 votes
1 answer
36 views

How to access a Render variable from the client (NODEJS + PUG)

exports.nuevoproyectoPST= async (req, res)=>{ const proyectos = await Proyectos.findAll(); //console.log(req.body); const {nombre} = req.body; let errores=[]; if (!nombre){ ...
Fabian Barua's user avatar
0 votes
1 answer
85 views

Using Object.assign() or spread ... operator in pug template

I have a 2 Pug files. The first define config object (base.pug) object like below const config = { name: 'abc', age: 25} The other Pug template (main.pug) which includes base.pug and wants to ...
Tanmayee 's user avatar

1
2 3 4 5
128