michaelbromley / ngx-pagination

Pagination for Angular
http://michaelbromley.github.io/ngx-pagination/
MIT License
1.21k stars 244 forks source link

When build project, do not create /dist/ngx-pagination. Error: Uncaught (in promise): Error: NG0203 #398

Open CastroSUPTIC opened 2 years ago

CastroSUPTIC commented 2 years ago

Angular version: 14

ngx-pagination version: 3.0.1

Description of issue: when i do build, i got an error NG0203. I think i'm getting this error because when i run ng build, i do not get the paste ngx-pagination in dist.

Steps to reproduce: run ng build, everything looks okay, but my web site isn't working well

Expected result: run in build the same as i'm running when i do ng serve

Actual result: getting ng0203

image

Any relevant code:

Here's my angular.json and tsconfig.json

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "SUBPLE_Angular": {
      "projectType": "application",
      "schematics": {},
      "root": "",
      "sourceRoot": "src",
      "prefix": "app",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist/subple-angular",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "tsconfig.app.json",
            "assets": [
              "src/favicon.ico",
              "src/assets"
            ],
            "styles": [
              "node_modules/bootstrap/dist/css/bootstrap.min.css",
              "./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css",
              "src/styles.css"
            ],
            "scripts": []
          },
          "configurations": {
            "production": {
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "3mb",
                  "maximumError": "4mb"
                },
                {
                  "type": "anyComponentStyle",
                  "maximumWarning": "15kb",
                  "maximumError": "16kb"
                }
              ],
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ],
              "outputHashing": "all"
            },
            "development": {
              "tsConfig": "projects/subple-angular/tsconfig.app.json"
            }
          },
          "defaultConfiguration": "production"
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "configurations": {
            "production": {
              "browserTarget": "SUBPLE_Angular:build:production"
            },
            "development": {              
              "browserTarget": "SUBPLE_Angular:build:development"
            }
          },
          "defaultConfiguration": "development"
        },
        "extract-i18n": {
          "builder": "@angular-devkit/build-angular:extract-i18n",
          "options": {
            "browserTarget": "SUBPLE_Angular:build"
          }
        },
        "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "src/test.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "tsconfig.spec.json",
            "karmaConfig": "karma.conf.js",
            "assets": [
              "src/favicon.ico",
              "src/assets"
            ],
            "styles": [
              "./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css",
              "src/styles.css"
            ],
            "scripts": []
          }
        }
      }
    }
  },
  "cli": {
    "analytics": "a3fa7531-b702-4c06-acb6-2c3e35a53e08"
  }
}
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "forceConsistentCasingInFileNames": true,
    "strict": true,
    "noImplicitAny": false,
    "noImplicitOverride": true,
    "noPropertyAccessFromIndexSignature": true,
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": true,
    "sourceMap": true,
    "paths": {
      "ngx-pagination": [
        "dist/ngx-pagination/ngx-pagination",
        "dist/ngx-pagination"
      ]
    },
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es2017",
    "module": "es2020",
    "lib": ["es2020", "dom"]
  },
  "typeRoots": ["node_modules/@angular/material"],
  "angularCompilerOptions": {
    "enableI18nLegacyMessageIdFormat": false,
    "strictInjectionParameters": true,
    "strictInputAccessModifiers": true,
    "strictTemplates": true
  }
}
michaelbromley commented 2 years ago

Hi, why are you using v3.0.1 of this library? That's a really old version which was built at the time when Angular was on like v4.

CastroSUPTIC commented 2 years ago

Hi, why are you using v3.0.1 of this library? That's a really old version which was built at the time when Angular was on like v4.

i thought it was v3.0.1 because is the last tag in tags section (https://github.com/michaelbromley/ngx-pagination/tags). after seeing the package.json i'm using the v6.0.2

michaelbromley commented 2 years ago

ok thanks.

I'm not sure how related to this library this issue is. Double-check you have wired it up correctly as per the docs, and then if the issue persists, provide a bit more info, i.e. show the code that you believe is responsible for triggering this error.