Open julianonunes opened 7 years ago
Sounds like you might need to run ng build
and then setup a liteServer.config.json file with something like this
{
"port": 8000,
"files": ["./dist/**/*.{html,htm,css,js}"],
"server": { "baseDir": "./dist" } /* this is the important part */
}
then run lite-server -c liteServer.config.json
Why not just cd
into dist
directory and run lite-server from there.
It's even more convenient with npx
:
cd dist
npx lite-server
@julianonunes did you ever find a solution? I'm encountering the same issue.
I've tried both suggestions by @zatchgordon and @impankratov with no luck.
I am running an Angular 7 CLI generated application.
I have the following bs-config.json -
{
"port": 8000,
"files": ["./dist/**/*.{html,htm,css,js}"],
"server": {"baseDir": "./dist"}
}
I run npm run dev
and get the following console errors -
Refused to execute inline script because it violates the following Content Security Policy directive: default-src self.
Either the unsafe-inline keyword, a hash (sha256-ThhI8UaSFEbbl6cISiZpnJ4Z44uNSq2tPKgyRTD3LyU=), or a nonce (nonce-...) is required to enable inline execution.
Note also that script-src was not explicitly set, so default-src is used as a fallback.
localhost/:1 Failed to load resource: the server responded with a status of 404 (Not Found)
A descriptive title
I'm creating a simple project using Angular-CLI, and it was working fine (when I run ng serve, the browser can load the page). However it was not detecting file changes, then I installed lite-server as I saw it being used on Angular Quicklaunch. The problem is that it runs fine, but nothing appears in the page content area.
Bug repro steps
The code and Dockerfile is available at https://github.com/julianonunes/angular_simple, I'm creating the project and running from a Docker container based on node:7.10 image.
Environment
lite-server
version: 2.3.0 (just installed locally)nodejs
version: v7.10.0npm
version: 4.2.0