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

Error: Module not found: Error: Can't resolve '@ng-bootstrap/ng-bootstrap' #89

Closed
mloffer opened this issue Nov 17, 2023 · 5 comments
Closed

Comments

@mloffer
Copy link

mloffer commented Nov 17, 2023

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

Missing dependency on build.

./node_modules/@ngneat/hotkeys/fesm2022/ngneat-hotkeys.mjs:8:0-49 - Error: Module not found: Error: Can't resolve '@ng-bootstrap/ng-bootstrap' in '**\@ngneat\hotkeys\fesm2022'

Error: node_modules/@ngneat/hotkeys/lib/hotkeys-help/hotkeys-help.component.d.ts:3:32 - error TS2307: Cannot find module '@ng-bootstrap/ng-bootstrap' or its corresponding type declarations.

3 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expected behavior

Should be able to follow instructions in README.md and get a working installation. No mention of dependencies that need to be manually installed.

Minimal reproduction of the problem with instructions

  1. Create a brand new Angular application
  2. Follow instructions in README.md (npm install @ngneat/hotkeys, add to app module)
  3. Run the app (ng serve)
  4. Above error occurs.

Additional observations:

  • It appears this PR added @ng-bootstrap/ng-bootstrap, @popperjs/core, and bootstrap to the test app. Without them, this package does not work. Shouldn't these be included in @ngneat/hotkeys's package.json as at least peerDependencies?
  • The PR also adds a reference for node_modules/bootstrap/scss/bootstrap.scss in angular.json's styles array.
  • The README should indicate how to provide these dependencies if not provided by the package.

Environment


Angular version: 16.2.12


Browser:
n/a
 
For Tooling issues:
- Node version: v18.17.1  
- Platform: Windows  

Others:

@dflor003
Copy link

dflor003 commented Dec 2, 2023

I'm running into this as well. Also, I have no intent to bring in bootstrap. I'm already using Angular Material and do not want to add another UI framework. Do you think it would be possible to split this library into two separate packages?

  1. Keep @ngneat/hotkeys as purely the hotkeys functionality without any UI components.
  2. Separate package for the dialog that folks can optionally bring in if they need it.

In my case, I'm actually not using any of the UI components from @ngneat/hotkeys. I rolled my own hotkeys dialog that aligns with the design of my app.

@NetanelBasal
Copy link
Member

The HotkeysHelpComponent is optional, but I see the issue. We can do what you suggest, but I'd go with removing the bootstrap dependency in favor of providing a class that implements the needed methods. Do you want to create a PR?

@Pilpin
Copy link
Contributor

Pilpin commented Mar 4, 2024

Hello @NetanelBasal do you know when you'll release a new version including this PR #90 ?
Thanks for all your work !

@NetanelBasal
Copy link
Member

Hi, if we are already introduces a breaking change maybe you can update to v17?

@Pilpin
Copy link
Contributor

Pilpin commented Mar 5, 2024

Hello, like so #91 ?

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

4 participants