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

Configuration instructions for implementing provideTippyConfig doesn't work in Angular Module boostrapping in v9+: "Type 'EnvironmentProviders' is not assignable to type 'Provider'." #156

Open
localpcguy opened this issue May 9, 2024 · 0 comments

Comments

@localpcguy
Copy link

localpcguy commented May 9, 2024

I'm submitting a...


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

Current behavior

Currently in v9+ if still using Angular Modules instead of the standalone component bootstrapping (i.e. using bootstrapApplication), trying to follow the instructions for setup in the README causes an error if trying to add it to the module providers.

Type 'EnvironmentProviders' is not assignable to type 'Provider'.

provideTippyConfig({
~~~~~~~~~~~~~~~~~~~~
    defaultVariation: 'primary',
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ... 
    },
   ~~~
}),

Prior to v9, it was not using makeEnvironmentProviders, and I don't question that change, as it has benefits and also Angular is moving towards Standalone components and so (as I understand it) this is correct for anyone who is starting a new app or has migrated their app to use the bootstrapApplication method instead of bootstrapping via a module.

Not 100% sure this counts as a regression as it was changed in a major version update, and so could just be considered a breaking change. I do think potentially this could be addressed with an update to the documentation for how to do it for legacy module-based apps, and if that is something that would be accepted, I could make a PR to update it. I'm definitely open to being wrong that I'm just doing something wrong and or misunderstanding the issue and if that's the case, please just let me know.

Expected behavior

Can use the documentation to get up and running with apps that (still) use Module to bootstrap.

Minimal reproduction of the problem with instructions

N/A

Describe the motivation or the concrete use case.

Ability for more people to be able to successfully follow the instructions and get running properly

Environment


Angular version: v17+
 
For Tooling issues:
- Node version: v20 LTS
- Platform:  Mac (likely irrelevant)

Suggested resolution:

This worked for me as a fallback until we can update to use bootstrapApplication, and so for the documentation, I would suggest (assuming my understanding is correct), adding a "legacy" section for module

@NgModule({
  ...
  providers: [
    ...
    {
      provide: TIPPY_CONFIG,
      useValue: {
        defaultVariation: 'tooltip',
        variations: {
          tooltip: tooltipVariation,
          popper: popperVariation,
        }
      },
    }
  ];
...
})l;
localpcguy added a commit to localpcguy/helipopper that referenced this issue May 9, 2024
… for legacy apps

Add information on how to configure TIPPY_CONFIG manually to avoid the
`Type 'EnvironmentProviders' is not assignable to type 'Provider'.` error
in Hellipopper v9+ when using module to bootstrap application.

Fixes ngneat#156
localpcguy added a commit to localpcguy/helipopper that referenced this issue May 9, 2024
… for legacy apps

Add information on how to configure TIPPY_CONFIG manually to avoid the
`Type 'EnvironmentProviders' is not assignable to type 'Provider'.` error
in Hellipopper v9+ when using module to bootstrap application.

Fixes ngneat#156
localpcguy added a commit to localpcguy/helipopper that referenced this issue May 9, 2024
… for legacy apps

Add information on how to configure TIPPY_CONFIG manually to avoid the
`Type 'EnvironmentProviders' is not assignable to type 'Provider'.` error
in Hellipopper v9+ when using module to bootstrap application.

Fixes ngneat#156
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

1 participant