mean-stack-angular5-crud icon indicating copy to clipboard operation
mean-stack-angular5-crud copied to clipboard

Error: No default engine was specified and no extension was provided.

Open useralive003 opened this issue 7 years ago • 6 comments

I created new login component i add routes for login but when try to run this page i am getting No default engine was specified and no extension was provided.can you please help me out if i want to add new pages what can i do help me

useralive003 avatar Jan 11 '18 11:01 useralive003

same thing happened for me

emilb604 avatar Jan 22 '18 23:01 emilb604

Me.. Too.. Plz Help

merby04 avatar Feb 15 '18 03:02 merby04

I had this issue and fixed with these two lines in app.js:

app.engine('html', require('ejs').renderFile); app.set('view engine', 'html');

There may be a better solution, as I am new to the MEAN stack myself. The only issue I am having now with this tutorial is any manual refresh of the browser or manual typing of urls bypasses the angular routes and tries to use the node routes. I've read a few posts about fixing this, but would love to see what didinj's solution would be.

JasonMonroe-EdgeTech avatar Feb 21 '18 23:02 JasonMonroe-EdgeTech

I also had this issue and found a fix for that, just add below code in app.js

app.use('/book-create', express.static(path.join(__dirname, 'dist')));
app.use('/book-details/:id', express.static(path.join(__dirname, 'dist')));
app.use('/book-edit/:id', express.static(path.join(__dirname, 'dist')));

after this code

app.use('/books', express.static(path.join(__dirname, 'dist')));

Above we are just defining the routes for each link. P.S. If anyone has any other solution, I would love to know that.

pranavwhiz avatar May 25 '18 11:05 pranavwhiz

Please I am having same error, I dont know whyyy

hiyamgh avatar Jul 17 '18 16:07 hiyamgh

add last line too as mentioned below with commenets app.use('/books', express.static(path.join(__dirname, 'dist'))); app.use('/book', book); app.use('', book); //add this line too

vickrant avatar Sep 02 '18 14:09 vickrant