Skip to content
New issue

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

Github README documentation Error for Serving the Site Locally #945

Closed
jonmchan opened this issue Mar 4, 2022 · 9 comments
Closed

Github README documentation Error for Serving the Site Locally #945

jonmchan opened this issue Mar 4, 2022 · 9 comments

Comments

@jonmchan
Copy link
Contributor

jonmchan commented Mar 4, 2022

https://github.com/grpc/grpc.io#serve-the-site-locally states npm run serve should start a server on port localhost:8888. However, the current server starts on http://localhost:1313/. When I tried to visit http://localhost:8888, there is no server listening on that port.

@jonmchan jonmchan added the bug Something isn't working label Mar 4, 2022
@jonmchan jonmchan changed the title Github README documentation Error Github README documentation Error for Serving the Site Locally Mar 4, 2022
jonmchan added a commit to EthicalIdentity/grpc.io that referenced this issue Mar 4, 2022
@chalin chalin added needs-info and removed bug Something isn't working labels Mar 5, 2022
@chalin
Copy link
Collaborator

chalin commented Mar 5, 2022

We have the same setup for several projects and local sites get served at port 8888. For example:

$ npm run serve                                                                                    
...
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

   ┌─────────────────────────────────────────────────┐
   │                                                 │
   │   ◈ Server now ready on http://localhost:8888   │
   │                                                 │
   └─────────────────────────────────────────────────┘

Note the message in the box: Server now ready on http://localhost:8888.

image

Maybe there's something wrong with your local setup.

@jonmchan
Copy link
Contributor Author

jonmchan commented Mar 5, 2022

I did a clean install and running from the main branch. Is there any additional setup besides npm install and npm run serve?

Jonathans-TI-MacBook-Pro:tmp jonathan$ git clone https://github.com/grpc/grpc.io.git
Cloning into 'grpc.io'...
remote: Enumerating objects: 6428, done.
remote: Counting objects: 100% (483/483), done.
remote: Compressing objects: 100% (327/327), done.
remote: Total 6428 (delta 247), reused 216 (delta 105), pack-reused 5945
Receiving objects: 100% (6428/6428), 22.67 MiB | 636.00 KiB/s, done.
Resolving deltas: 100% (3919/3919), done.
Jonathans-TI-MacBook-Pro:tmp jonathan$ cd grpc.io/
Jonathans-TI-MacBook-Pro:grpc.io jonathan$ git branch
* main
Jonathans-TI-MacBook-Pro:grpc.io jonathan$ npm install
...

Jonathans-TI-MacBook-Pro:grpc.io jonathan$ npm run serve

> preserve
> npm run _prebuild


> _prebuild
> npm run get:submodule


> get:submodule
> npm run _get:${GET:-submodule}


> _get:submodule
> set -x && git submodule update --init --recursive ${DEPTH:- --depth 1}

+ git submodule update --init --recursive --depth 1

> serve
> npm run _serve


> _serve
> netlify dev -c "npm run _serve:hugo"

◈ Netlify Dev ◈
◈ Ignored general context env var: LANG (defined in process)
◈ Starting Netlify Dev with Hugo

> _serve:hugo
> hugo serve -DFE --minify

Start building sites … 
hugo v0.93.2-643B5AE9+extended darwin/amd64 BuildDate=2022-03-04T12:21:49Z VendorInfo=gohugoio
WARN 2022/03/05 14:15:04 The google_news internal template will be removed in a future release. Please remove calls to this template. See https://github.com/gohugoio/hugo/issues/9172 for additional information.
WARN 2022/03/05 14:15:05 .Path when the page is backed by a file is deprecated and will be removed in a future release. We plan to use Path for a canonical source path and you probably want to check the source is a file. To get the current behaviour, you can use a construct similar to the one below:

  {{ $path := "" }}
  {{ with .File }}
	{{ $path = .Path }}
  {{ else }}
	{{ $path = .Path }}
  {{ end }}


Re-run Hugo with the flag --panicOnWarning to get a better error message.

                   | EN   
-------------------+------
  Pages            | 143  
  Paginator pages  |   4  
  Non-page files   |   0  
  Static files     | 177  
  Processed images |   0  
  Aliases          |   1  
  Sitemaps         |   1  
  Cleaned          |   0  

Built in 1283 ms
Watching for changes in /tmp/grpc.io/{archetypes,assets,content,data,layouts,package.json,static,themes}
Watching for config changes in /tmp/grpc.io/config.yaml, /tmp/grpc.io/themes/docsy/config.toml
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

Only 1313 is listening:

Jonathans-TI-MacBook-Pro:~ jonathan$ sudo lsof -PiTCP -sTCP:LISTEN|egrep '1313|8888'
hugo      23644 jonathan 7871u  IPv4 0x187898ad287cc139      0t0  TCP localhost:1313 (LISTEN)

My setup:

Jonathans-TI-MacBook-Pro:grpc.io jonathan$ sw_vers 
ProductName:	Mac OS X
ProductVersion:	10.15.7
BuildVersion:	19H1615
Jonathans-TI-MacBook-Pro:grpc.io jonathan$ npm --version
8.3.1
Jonathans-TI-MacBook-Pro:grpc.io jonathan$ node --version
v17.4.0

@jonmchan
Copy link
Contributor Author

jonmchan commented Mar 5, 2022

It would appear the netlify proxy is not starting? I believe it should be running on both 1313 and 8888 for a proper setup? Can someone please confirm. Thank you.

@chalin
Copy link
Collaborator

chalin commented Mar 5, 2022

Which version of node are you using? (And which version of macOS?)

@jonmchan
Copy link
Contributor Author

jonmchan commented Mar 6, 2022

My setup:

Jonathans-TI-MacBook-Pro:grpc.io jonathan$ sw_vers 
ProductName:	Mac OS X
ProductVersion:	10.15.7
BuildVersion:	19H1615
Jonathans-TI-MacBook-Pro:grpc.io jonathan$ npm --version
8.3.1
Jonathans-TI-MacBook-Pro:grpc.io jonathan$ node --version
v17.4.0

@chalin
Copy link
Collaborator

chalin commented Mar 6, 2022

Could you try again using the latest LTS version of Node, that is, version 16? That's the version we officially use.

@chalin
Copy link
Collaborator

chalin commented Mar 7, 2022

It seems that the Netlify CLI doesn't currently work under Node v17. For details, see netlify/cli#3617 -- in particular netlify/cli#3617 (comment).

I'm going to close this issue for now. If you're still having problems under Node v16, feel free to reopen the issue and/or add a comment here.

@chalin chalin closed this as completed Mar 7, 2022
@jonmchan
Copy link
Contributor Author

jonmchan commented Mar 7, 2022

@chalin thanks for your suggestions and help. Confirmed, netlify works when using the proper node version.

Logs:

$ node --version
v16.14.0

$ npm run serve
...
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

   ┌─────────────────────────────────────────────────┐
   │                                                 │
   │   ◈ Server now ready on http://localhost:8888   │
   │                                                 │
   └─────────────────────────────────────────────────┘


I can confirm that both localhost:1313 and localhost:8888 are now properly serving locally when starting the server.

@chalin
Copy link
Collaborator

chalin commented Mar 7, 2022

Great, thanks for confirming!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants