primefaces / primeng

The Most Complete Angular UI Component Library
https://primeng.org
Other
10.15k stars 4.54k forks source link

CodeHighlighter module has been removed since 15.2.1 release #12840

Open bougnat12 opened 1 year ago

bougnat12 commented 1 year ago

Describe the bug

I updated my project from primeng 15.2.0 to 15.2.1 and had this issue:

./src/app/app.module.ts:9:0-64 - Error: Module not found: Error: Package path ./codehighlighter is not exported from package /Users/pfradin/Documents/projets/mad-console/node_modules/primeng (see exports field in /Users/pfradin/Documents/projets/mad-console/node_modules/primeng/package.json)

Error: src/app/app.module.ts:9:39 - error TS2307: Cannot find module 'primeng/codehighlighter' or its corresponding type declarations.

9 import { CodeHighlighterModule } from 'primeng/codehighlighter';
                                        ~~~~~~~~~~~~~~~~~~~~~~~~~

Why this module has disappeared?

I have the same issue with the last 15.3.0 release.

Environment

Angular CLI 15.2.4, Angular 15.2.5. Here is the content of my package.json file:

{
  "name": "mad-console",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "test-coverage": "ng test --source-map --preserve-symlinks --code-coverage",
    "lint": "ng lint --format stylish; pretty-quick --list-different --verbose --no-resolve-config",
    "lint-staged": "ng lint --format stylish; pretty-quick --staged",
    "e2e": "ng e2e --headless --no-watch",
    "eslint": "eslint",
    "fr": "ng serve --configuration=fr",
    "i18n": "ng extract-i18n --output-path src/locale --format=xlf2"
  },
  "pre-commit": "lint-staged",
  "private": true,
  "dependencies": {
    "@angular/animations": "15.2.5",
    "@angular/common": "15.2.5",
    "@angular/compiler": "15.2.5",
    "@angular/core": "15.2.5",
    "@angular/forms": "15.2.5",
    "@angular/localize": "15.2.5",
    "@angular/platform-browser": "15.2.5",
    "@angular/platform-browser-dynamic": "15.2.5",
    "@angular/router": "15.2.5",
    "@sgbj/angular-prism": "0.2.1",
    "@types/prismjs": "1.26.0",
    "angular2-websocket": "0.9.8",
    "bootstrap": "5.2.3",
    "font-awesome": "4.7.0",
    "global": "4.4.0",
    "moment": "2.29.4",
    "primeicons": "6.0.1",
    "primeng": "15.2.1",
    "prismjs": "1.29.0",
    "rxjs": "7.8.0",
    "tslib": "2.5.0",
    "zone.js": "0.13.0"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "15.2.4",
    "@angular-eslint/builder": "15.2.1",
    "@angular-eslint/eslint-plugin": "15.2.1",
    "@angular-eslint/eslint-plugin-template": "15.2.1",
    "@angular-eslint/schematics": "15.2.1",
    "@angular-eslint/template-parser": "15.2.1",
    "@angular/cli": "15.2.4",
    "@angular/compiler-cli": "15.2.5",
    "@angular/language-service": "15.2.5",
    "@cypress/schematic": "2.5.0",
    "@types/jasmine": "4.3.1",
    "@typescript-eslint/eslint-plugin": "5.57.0",
    "@typescript-eslint/parser": "5.57.0",
    "cypress": "12.9.0",
    "eslint": "8.37.0",
    "eslint-config-prettier": "8.8.0",
    "eslint-plugin-deprecation": "1.3.3",
    "eslint-plugin-import": "2.27.5",
    "eslint-plugin-jsdoc": "40.1.0",
    "eslint-plugin-prefer-arrow": "1.2.3",
    "eslint-plugin-prettier": "4.2.1",
    "eslint-plugin-unicorn": "46.0.0",
    "jasmine-core": "4.6.0",
    "karma": "6.4.1",
    "karma-chrome-launcher": "3.1.1",
    "karma-coverage": "2.2.0",
    "karma-firefox-launcher": "2.1.2",
    "karma-jasmine": "5.1.0",
    "karma-jasmine-html-reporter": "2.0.0",
    "karma-json-reporter": "1.2.1",
    "lint-staged": "13.2.0",
    "pre-commit": "1.2.2",
    "prettier": "2.8.7",
    "pretty-quick": "3.1.3",
    "typescript": "4.9.5"
  },
  "prettier": {
    "printWidth": 140,
    "singleQuote": true,
    "arrowParens": "always",
    "trailingComma": "none",
    "overrides": [
      {
        "files": "*.component.html",
        "options": {
          "parser": "angular"
        }
      },
      {
        "files": "*.html",
        "options": {
          "parser": "html"
        }
      }
    ]
  }
}

My app.modules.ts file:

// Angular imports
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import { RouterModule } from '@angular/router';

// PrimeNG codehighlighter module use to highlight HTTP / Websocket JSON response
import { CodeHighlighterModule } from 'primeng/codehighlighter';

// Routes definition
import { ROUTES } from './app.routes';

// Our component imports
import { AppComponent } from './app.component';
import { HttpApiComponent } from './http-api/http-api.component';
import { LoginComponent } from './login/login.component';
import { MenuComponent } from './menu/menu.component';
import { TrexdApiComponent } from './trexd-api/trexd-api.component';
import { WebsocketApiComponent } from './websocket-api/websocket-api.component';

// Our common pipes imports
import { FromNowPipe } from './pipes/from-now.pipe';

// Our services imports
import { JwtInterceptor } from './services/jwt.interceptor';

@NgModule({
  bootstrap: [AppComponent],
  declarations: [AppComponent, FromNowPipe, HttpApiComponent, LoginComponent, MenuComponent, TrexdApiComponent, WebsocketApiComponent],
  imports: [BrowserModule, CodeHighlighterModule, FormsModule, HttpClientModule, ReactiveFormsModule, RouterModule.forRoot(ROUTES, {})],
  providers: [{ provide: HTTP_INTERCEPTORS, useExisting: JwtInterceptor, multi: true }]
})
export class AppModule {}

Reproducer

No response

Angular version

15.2.4

PrimeNG version

15.2.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.15.0

Browser(s)

No response

Steps to reproduce the behavior

Just run yarn start to compile and server my Angular app.

Same issue with yarn test-coverage obviously.

Expected behavior

I'd like to have the CodeHighlighterModule in the last primeng release.

bougnat12 commented 1 year ago

Same issue with 15.4.0/15.4.1 releases. I'm stuck to 15.2.0 and cannot upgrade my application. It's really annoying. What is the state of this bug please?

bougnat12 commented 1 year ago

Same issue with 16.0.0-rc.1 release too.

hsalinasChub commented 1 year ago

Still seeing this issue. I'll need to switch to highlight and I'm actively trying to not include more packages in our project. Please update when a fix is available.

John-Santacruz commented 12 months ago

Same issue with V16.3.1 and angular 16

jeffreyansell commented 12 months ago

removed here, no clear reason: https://github.com/primefaces/primeng/commit/53b344d3ee17d01ca4e09899ca441a1cd0ab92fe