Coder Social home page Coder Social logo

Comments (10)

MurhafSousli avatar MurhafSousli commented on September 22, 2024

Could you fill the issue template properly, which angular version are you using?

from ngx-highlightjs.

CharlieGreenman avatar CharlieGreenman commented on September 22, 2024

Angular 15. Angular version here is irrelevant as well as node version, OS version etc. I might make a pull request tomorrow. Will keep you posted

from ngx-highlightjs.

MurhafSousli avatar MurhafSousli commented on September 22, 2024

It is important if it is a real issue, it should be documented which version of the library and which in angular version!

from ngx-highlightjs.

CharlieGreenman avatar CharlieGreenman commented on September 22, 2024

Noted. I must have missed that. It's Angular Version 15 and "ngx-highlightjs": "^7.0.1",

from ngx-highlightjs.

MurhafSousli avatar MurhafSousli commented on September 22, 2024

For me, it works fine with Angular 15, I couldn't reproduce it, What is exactly the error?

from ngx-highlightjs.

CharlieGreenman avatar CharlieGreenman commented on September 22, 2024

I will get to and try again today/tomorrow and report back. My apologies

from ngx-highlightjs.

CharlieGreenman avatar CharlieGreenman commented on September 22, 2024

My apologies for the delay, still looking into it. Will confirm tomorrow if indeed an error, or something I did on my end.

from ngx-highlightjs.

CharlieGreenman avatar CharlieGreenman commented on September 22, 2024

I was able to circle back to today as we finally got angular universal build working/deployed. The following is the error I am getting:

Generating browser application bundles (phase: emitting)...ERROR ReferenceError: requestAnimationFrame is not defined
    at requestAnimationFrame (./node_modules/rxjs/dist/esm/internal/scheduler/animationFrameProvider.js:19:105)
    at requestAsyncId (./node_modules/rxjs/dist/esm/internal/scheduler/AnimationFrameAction.js:14:64)
    at schedule (./node_modules/rxjs/dist/esm/internal/scheduler/AsyncAction.js:24:72)
    at schedule (./node_modules/rxjs/dist/esm/internal/Scheduler.js:8:57)
    at setTextContent (./node_modules/ngx-highlightjs/fesm2020/ngx-highlightjs.mjs:372:9)
    at highlightElement (./node_modules/ngx-highlightjs/fesm2020/ngx-highlightjs.mjs:336:14)
    at ngOnChanges (./node_modules/ngx-highlightjs/fesm2020/ngx-highlightjs.mjs:320:22)
    at call (./node_modules/@angular/core/fesm2020/core.mjs:1574:14)
    at callHook (./node_modules/@angular/core/fesm2020/core.mjs:2498:18)
    at callHooks (./node_modules/@angular/core/fesm2020/core.mjs:2457:17)
    ```
  
    It is being used as following in my `ui-common.module.ts` file:
    ```
    providers: [
      {
        provide: HIGHLIGHT_OPTIONS,
        useValue: {
          coreLibraryLoader: () => import('highlight.js/lib/core'),
          lineNumbersLoader: () => import('highlightjs-line-numbers.js'),
          languages: {
            typescript: () => import('highlight.js/lib/languages/typescript'),
            javascript: () => import('highlight.js/lib/languages/javascript'),
            scss: () => import('highlight.js/lib/languages/scss'),
            xml: () => import('highlight.js/lib/languages/xml'),
            css: () => import('highlight.js/lib/languages/css'),
          },
        },
      },
    ],
    ``` 

from ngx-highlightjs.

PieterjanDeClippel avatar PieterjanDeClippel commented on September 22, 2024

Same here

ng add @nguniversal/express-engine

Configuration:

{
  provide: HIGHLIGHT_OPTIONS,
  useValue: <HighlightOptions>{
    fullLibraryLoader: () => import('highlight.js'),
    themePath: 'solarized-dark.css'
  }
},

from ngx-highlightjs.

MurhafSousli avatar MurhafSousli commented on September 22, 2024

I tried to replicate the issue with Angular Universal but it worked fine, I couldn't reproduce this error! Anyway, I added a check in the ngOnChanges just in case.

Please try again with v8.0.0 and let me know if it worked out!

from ngx-highlightjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.