angular-fullstack / generator-angular-fullstack

Yeoman generator for an Angular app with an Express server
https://awk34.gitbook.io/generator-angular-fullstack
6.13k stars 1.24k forks source link

localhost:9000 is blank #2192

Open esinhalilov opened 8 years ago

esinhalilov commented 8 years ago
Item Version
generator-angular-fullstack 4.0.1
Node 6.5.0
npm 3.10.3
Operating System OS X 10
Item Answer
Transpiler Babel
Markup HTML
CSS LESS
Router ui-router
Client Tests Mocha
DB MongoDB
Auth Y

after executing 'gulp serve' localhost:3000 works, but client side doesn't. I am adding ng-app to the body tag and also I am adding a new div element with ui-view attribute. main controller and page is not rendered.

Am I missing something?

Awk34 commented 8 years ago

It defaults to localhost:9000, not 3000 fyi. Also you shouldn't be adding an ng-app directive.

Do you get any errors?

RonAlmog commented 8 years ago

any errors in your console after running 'gulp serve'? is the browser opening? if yes, open dev console in your browser. and look for errors. do you have mongodb running (better run as a service) ?

esinhalilov commented 8 years ago

Hi,

after generating application and there are no changes at all with I am running 'gulp server' and output is below. Application localhost:3000 works perfect: I can log in create new feature register a new user but front end/proxy url localhost:9000 is blank. There is no 'ng-app' added at all in the client/_index.html which then generates index.html. If I open developer_tools there is javascript error:

vendor.bundle.js:1 Uncaught SyntaxError: Unexpected token < polyfills.bundle.js:1 Uncaught SyntaxError: Unexpected token < app.bundle.js:1 Uncaught SyntaxError: Unexpected token <

[OUTPUT FROM GULP SERVE]

[BS] Proxying: http://localhost:9000 [BS] Access URLs:

Local: http://localhost:3000 External: http://192.168.123.9:3000

UI: http://localhost:3002' UI External: http://192.168.123.9:3002

finished populating users webpack: wait until bundle finished: / Error: ENOENT: no such file or directory, stat '/Users/esin/Development/opss/client/index.html' at Error (native) GET / 404 767.278 ms - 139 webpack done hook Hash: 6821f98f021d07f83461 Version: webpack 1.13.2 Time: 6949ms

              Asset     Size  Chunks             Chunk Names
      app.bundle.js   409 kB       0  [emitted]  app
      polyfills.bundle.js   206 kB       1  [emitted]  polyfills
   vendor.bundle.js  2.45 MB       2  [emitted]  vendor
  app.bundle.js.map   509 kB       0  [emitted]  app
  polyfills.bundle.js.map   269 kB       1  [emitted]  polyfills
 vendor.bundle.js.map  2.85 MB       2  [emitted]  vendor
../client/index.html  1.39 kB          [emitted]  
Child html-webpack-plugin for "../client/index.html":

               Asset     Size  Chunks       Chunk Names
 ../client/index.html  2.69 kB       0       
 webpack: bundle is now VALID.
webpack: bundle is now INVALID.
webpack: wait until bundle finished: /vendor.bundle.js
webpack: wait until bundle finished: /polyfills.bundle.js
webpack: wait until bundle finished: /app.bundle.js
Koslun commented 8 years ago

@esinhalilov In development mode the site is served to port 3000 by default through browserSync which is tightly coupled to the bundle emitted by webpack. So port 3000 is the only place I would expect to see a page in the browser.

If you access port 9000 in development mode you would only see the API, i.e. blank, I believe. Though in production the express server instead also serves the already generated webpack bundle.

The output you listed should at some point finish with webpack: bundle is now VALID. again. Aborted before the bundle finished or did it not finish within a minute or so? Though everything is working since you can see and do stuff at port 3000?

Awk34 commented 8 years ago

@Koslun oh, I didn't realize that had changed.

samsfisher commented 8 years ago

Hello, I am getting webpack: bundle is now VALID when i do gulp serve.

However, the system is not watching for any changes to code. I have to stop and do gulp serve again. I am using vagrant as the development server. Following ports are forward: 3000, 9000, 27017. Am i missing something

shaldipur commented 8 years ago

I ran into the same issue this evening.

shaldipur commented 8 years ago

The problem is related the way the tag is being interpreted:

screen shot 2016-09-17 at 1 39 50 pm

shaldipur commented 8 years ago

I believe index.html shouldn't be called at all, but for some odd reason it defaults to it.

shaldipur commented 8 years ago

Refer to #2164, it may help you.