Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Error loading js on Angular

Hi. I'm having some difficulties when implementing angular on my app.

I'm using a MEAN app, with pugs files. I've included the js files on the layoyt.pug after the body tag.

The angular module is been read with ng-app on the body tag.

However, I get the following errors on Chrome console:

dashboard:184 GET http://localhost:3000/scripts/hello-world.js dashboard:184 GET http://localhost:3000/scripts/app.js dashboard:184 GET http://localhost:3000/scripts/app.js dashboard:184 GET http://localhost:3000/scripts/hello-world.js 404 (Not Found)

I've already tried to change the path of the files on the layout.pug file, but doesn't work at all.

Any one can help me?

1 Answer

Seth Kroger
Seth Kroger
56,413 Points

It would help if you showed your code, but the next thing you should check is if you set up the static middleware is set up correctly so it can serve the JS files.