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

execute “ng serve -o” visit “http://localhost:4200” error "Cannot GET /" #76

Open
suangencong opened this issue Feb 19, 2023 · 3 comments

Comments

@suangencong
Copy link

The following is the error message . Please help to see how to solve it. Thank you for your support .

一、execute "npm install --legacy-peer-deps " error
Compiling @angular/cdk/drag-drop : es2015 as esm2015
Compiling @angular/cdk/keycodes : es2015 as esm2015
Compiling @angular/cdk/layout : es2015 as esm2015
Compiling @angular/cdk/observers : es2015 as esm2015
Compiling @angular/cdk/overlay : es2015 as esm2015
Compiling @angular/cdk/platform : es2015 as esm2015
Error: Failed to compile entry-point @angular/cdk/drag-drop (es2015 as esm2015) due to compilation errors:
node_modules/@angular/cdk/scrolling/scrolling-module.d.ts:8:22 - error NG6003: Appears in the NgModule.exports of DragDropModule, but could not be resolved to an NgModule, Component, Directive, or Pipe class.

This lik

二、execute “ng serve -o” error

PS D:\company_work_project\shopizer\shopizer-admin-snyk-fix-d039072a6e2072b60be3e8509cc89dbb> ng serve -o
√ Browser application bundle generation complete.

Initial Chunk Files | Names | Size
main.js | main | 0 bytes
polyfills.js | polyfills | 0 bytes
runtime.js | runtime | 0 bytes
scripts.js | scripts | 0 bytes
styles.css, styles.js | styles | 0 bytes
vendor.js | vendor | 0 bytes

                  | Initial Total | 0 bytes

Build at: 2023-02-19T06:08:36.689Z - Hash: aaabff7d11493e0f3b82 - Time: 60189ms

Error: node_modules/@angular-devkit/schematics/node_modules/@angular-devkit/core/node_modules/ajv/dist/types/json-schema.d.ts:1:92 - error TS1005: '?' expected.

1 declare type StrictNullChecksWrapper<Name extends string, Type> = undefined extends null ? strictNullChecks must be true in tsconfig to use ${Name} : Type;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@angular-devkit/schematics/node_modules/@angular-devkit/core/node_modules/ajv/dist/types/json-schema.d.ts:1:151 - error TS1005: ';' expected.

1 declare type StrictNullChecksWrapper<Name extends string, Type> = undefined extends null ? strictNullChecks must be true in tsconfig to use ${Name} : Type;
~

** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **

三、Browser console error
GET http://localhost:4200/ 404 (Not Found)
Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "default-src 'none'". Note that 'script-src' was not explicitly set, so 'default-src' is used as a fallback.

@modi9hassan
Copy link

I have the same issue, please any help?

@tiagovt
Copy link

tiagovt commented Aug 29, 2023

I can run with this content.module.ts:
``import { NgModule } from '@angular/core';
import { ContentRoutingModule, routedComponents } from './content-routing.module';
import { SharedModule } from '../shared/shared.module';
// import { ngfModule } from 'angular-file';
import { QueryBuilderModule } from "angular2-query-builder";
import { NbDialogModule } from '@nebular/theme';
import { NgxDropzoneModule } from 'ngx-dropzone';
import { LightboxModule } from 'ngx-lightbox';
import { MalihuScrollbarModule } from 'ngx-malihu-scrollbar';
import { FileManagerModule } from 'ng6-file-man';
import { NgxSummernoteModule } from 'ngx-summernote';
import { CustomModule } from '../custom-component/custom.module';
@NgModule({
declarations: [
...routedComponents
],
imports: [
ContentRoutingModule,
SharedModule,
// ngfModule,
FileManagerModule,
QueryBuilderModule,
NbDialogModule.forChild(),
NgxSummernoteModule,
NgxDropzoneModule,
LightboxModule,
MalihuScrollbarModule.forRoot(),
CustomModule
],
// exports: [ngfModule]
exports: []
})
export class ContentModule { }

@181850036
Copy link

got the same problem 2

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

No branches or pull requests

4 participants