We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The included template code is missing all LI-tags in the UL-tag
I'm using VSCode and the CODEGPT extension suggests exactly the same code so I suspect it's a bug in EJS
Template code:
<% const dbQuery = function(mysql) { return new Promise((resolve, reject) => { con.query(mysql, (err, result) => { if (err) { reject(err); } else { resolve(result); } }); }); } %> <h2>Products</h2> <ul> <% dbQuery("SELECT * FROM products") .then(products => { console.log("Data received from database: ", products); products.forEach(product => { console.log("Product name: ", product.name); %> <li> <%= product.name %> </li> <% } ) } ) .catch(err => console.log("Error fetching data from database: ", err)); %> </ul>
Console output:
Data received from database: [ RowDataPacket { id: 1, name: 'Product 1', price: 101 }, RowDataPacket { id: 2, name: 'Product 2', price: 51 }, RowDataPacket { id: 3, name: 'Product 3', price: 12 } ] Product name: Product 1 Product name: Product 2 Product name: Product 3
Rendered html:
<ul> </ul>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The included template code is missing all LI-tags in the UL-tag
I'm using VSCode and the CODEGPT extension suggests exactly the same code so I suspect it's a bug in EJS
Template code:
Console output:
Rendered html:
The text was updated successfully, but these errors were encountered: