johnpapa / johnpapa/lite-server

Don´t open the correct URL when i start the server.

Open
#165 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.3k
Forks
262
PR merge metrics
No merged PRs in 30d

Description

### When I start the server, it opens a wrong URL.

When i run the command to start lite-server, an new page is open. But the URL that appear in browser is incorrect.

The lite-server's log shows:

[1] Did not detect a `bs-config.json` or `bs-config.js` override file. Using lite-server defaults...
[1] ** browser-sync config **
[1] { injectChanges: false,
[1] files: [ './**/*.{html,htm,css,js}' ],
[1] watchOptions: { ignored: 'node_modules' },
[1] server: { baseDir: 'app', middleware: [ [Function], [Function] ] } }
[1] [Browsersync] Access URLs:
[1] ------------------------------------
[1] Local: http://localhost:3000
[1] External: http://10.80.80.84:3000
[1] ------------------------------------
[1] UI: http://localhost:3001
[1] UI External: http://localhost:3001
[1] ------------------------------------
[1] [Browsersync] Serving files from: app
[1] [Browsersync] Watching files...
[1] [Browsersync] Reloading Browsers... (buffered 9 events)`

The correct URL should be **http://localhost:3000**, but what I get is **http://localhost/?line=3000&column=0**.

Follow the link of my github project, where are the packege.json and tsconfig.json.
[alurabank](https://github.com/juceliohv/alurabank)

### Bug repro steps

1. My git project, mentioned above, is a project to test my typescript skills. Therefore it is necessary to download it and verify that the package.json file is properly installed.
2. run the command on the project root folder => `npm start`
3. A browser window will be open with the wrong url.

### Environment
- `lite-server` version: 2.3.0
- `nodejs` version: 6.11.4
- `npm` version: 6.11.3
- OS type/version: kubuntu 19.04 x64
- browser: Google Chrome update 75

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the report from the linked alurabank project by inspecting package.json, tsconfig.json, and the npm start entry point. Compare lite-server and BrowserSync's URL-opening behavior with the logged access URLs. Done means starting the server opens http://localhost:3000 instead of the reported localhost query URL.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs, typescript
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.