shopizer-ecommerce / shopizer-admin

MIT License
49 stars 137 forks source link

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

Open suangencong opened 1 year ago

suangencong commented 1 year ago

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 commented 1 year ago

I have the same issue, please any help?

tiagovt commented 11 months ago

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 commented 4 days ago

got the same problem 2