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

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

Open
CastroSUPTIC opened this issue Sep 29, 2022 · 3 comments

Comments

@CastroSUPTIC
Copy link

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
  }
}

@CastroSUPTIC CastroSUPTIC changed the title When build project, do not create /dist/ngx-pagination When build project, do not create /dist/ngx-pagination. Error: Uncaught (in promise): Error: NG0203 Sep 29, 2022
@michaelbromley
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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.

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

2 participants