ngworker / lumberjack

Chop and cut Angular logs like a professional lumberjack.
https://ngworker.github.io/lumberjack/
MIT License
184 stars 20 forks source link

Failed to use lumberjack for angular 16 #170

Closed roka-actico closed 1 year ago

roka-actico commented 1 year ago

Describe the bug

lumberjack cannot be used together with angular 16

To Reproduce

  1. run 'npm install'
  2. console shows errors
could not resolve dependency:
peer: @angular/core@"^15.0.1" from @ngworker/lumberjack@15.0.1

Expected behavior

lumberjack should be installed and usable

Environment

see the following excerpt from our 'package.json'

  "dependencies": {
    "@angular/animations": "16.1.7",
    "@angular/cdk": "16.1.6",
    "@angular/common": "16.1.7",
    "@angular/compiler": "16.1.7",
    "@angular/core": "16.1.7",
    "@angular/forms": "16.1.7",
    "@angular/platform-browser": "16.1.7",
    "@angular/platform-browser-dynamic": "16.1.7",
    "@angular/router": "16.1.7",

  },
  "devDependencies": {
    "@angular-builders/custom-webpack": "16.0.0",
    "@angular-devkit/build-angular": "16.0.0",
    "@angular-devkit/core": "16.1.6",
    "@angular-devkit/schematics": "16.1.6",
    "@angular-eslint/eslint-plugin": "16.0.3",
    "@angular-eslint/eslint-plugin-template": "16.0.3",
    "@angular-eslint/template-parser": "16.0.3",
    "@angular/cli": "~16.1.0",
    "@angular/compiler-cli": "16.1.7",
    "@angular/language-service": "16.1.7",
NachoVazquez commented 1 year ago

Thanks for the issue report we will take care to this asap.

NachoVazquez commented 1 year ago

Hi @roka-actico, you can now install @ngworker/lumberjack@15.0.4 in an Angular 16 project.

If you find any issues, please let me know.

roka-actico commented 1 year ago

wow @NachoVazquez - many thanks for the quick response and fix. We will try and let you know.

LayZeeDK commented 1 year ago

Lumberjack 15 doesn't have official support for Angular 16 but is likely to work.

However, the proper solution is one of:

  1. Wait for Lumberjack 16
  2. Use legacy peer dependencies when installing
  3. Add module resolutions
roka-actico commented 1 year ago

@LayZeeDK thank you for clearing this up. Do you have an Idea about a shedule for the official Angular 16 support?

Don't understand me wrong, I know it's hard to cope with the major angular releases every 6 months - especially for an OSS project. I just want to know enough to understand my options.

And I see another option:

  1. use lumberjack 15.0.4
NachoVazquez commented 1 year ago

Yes, @roka-actico you can use version 15.0.4 for now, and you will be ok. There should only be major changes to version 15 once version 16 is released.

Alternatively, you can install your dependencies using npm install --legacy-peer-deps.

Although we don't have an explicit schedule for version 16, I can say we are currently working on it. It is taking longer than expected because, in version 16, Lumberjack will experience significant changes see https://github.com/ngworker/lumberjack/discussions/166.

However, the API should remain almost identical, and the migration should be relatively straightforward.

LayZeeDK commented 1 year ago

Options 2 and 3 imply Lumberjack 15.x. The solution is to learn how to cope with situations like this using your package manager of choice.