-
Notifications
You must be signed in to change notification settings - Fork 3
Error on loading material components #32
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
Comments
Adding more details as below, Below are the workspace .jsonc contents: { |
Looks like a similar issue as below, |
Hmm I wonder if the Material module needs to be pre-compiled with ngcc even in v13, I'll do some tests tomorrow |
Can you try to add |
Moved @angular/material to the peerDependencies. Started to get below errors on bit install Below is the updated workspace .jsonc contents: { |
Completed above suggested steps, Moved @angular/material to the peerDependencies. Still getting same error |
@ocombe Let me know if you find something around this, Thanks. |
UPDATE bvm version: 0.0.30
Below is the dependency list
Below is the dependency list
Below is the dependency list
It gave the same error before setting preserveSymlinks: true in angular.json file @ocombe Hope this analysis will helps! |
UPDATE Tried from sratch on brand new dev boxes with below configurations, OS: Windows 10 Followed below steps: OK - bit new ng-workspace checkone -a teambit.angular/angular-v11 Everything ran correctly and the component was loaded with default text. Added material as peer dependencies using below commands, OK - bit install @angular/[email protected] --type peer Added new material button in above component (https://material.angular.io/components/button/examples)
FAILED - bit start - Failed with multiple errors Re-tried with below commands, OK - bit capsule delete --all OK - bit install FAILED - bit start - see below for error messages, tried above steps on two different dev boxes, Error on DEV BOX 1: Error on DEV BOX 2: |
Would be great to hear and have some help around this, kind of have hit a dead end here! |
I'm working on a fix, it should be released today hopefully |
That's great @ocombe , Looking forward for the same, Thanks! I will try out with adding different material components once the fix is available. |
Can you run the new version that I just released ? |
Sure, will try with teambit.angular/[email protected] Shall I follow the same steps that i tried above on 2 DEV boxes? Let me know if anything additional step is required. |
just change the number in workspace.jsonc and run |
sure, let me give it a try |
I tested with below material components, Button - SUCCESS Badge - SUCCESS Autocomplete - FAILED Error - Datepicker - FAILED Error - Note - All imports and providers are added correctly and are working fine with standalone Angular application. Seems like components which requires injectors/providers are not rendering correctly. @ocombe , any thoughts on this? I will run few more tests over this week and will update the issue. |
@ocombe , here is the solution if you want to give it a try, |
Hmm, nice catch, I'll take a look at it tomorrow, but that's weird |
One observation regarding styling for material components, When we add material support to any standalone Angular application using below command,
It performs certain steps to add prebuilt themes, typography, etc. Refer to below URL https://material.angular.io/guide/getting-started How do we configure those steps while adding components using bit? By default the material stylings are not applied |
I fixed the issue but I can't publish a new version right now due to a bug in bit, I'll let you know when it's available |
Sounds Good @ocombe , Looking forward for the new build to try out with complex material components, Thanks! Also do check out on above observation regarding styling/effects for material components not getting applied by default. |
Ah yes, you can use a custom env and do something like that (obviously adapted to material): angular.overrideAngularOptions({styles: [
require.resolve('bootstrap/dist/css/bootstrap.min.css'),
require.resolve('@fortawesome/fontawesome-free/css/all.css'),
require.resolve('primeicons/primeicons.css'),
require.resolve('primeng/resources/primeng.css'),
require.resolve('primeng/resources/themes/nova-accent/theme.css')
], scripts: [
require.resolve('jquery/dist/jquery.min.js'),
require.resolve('bootstrap/dist/js/bootstrap.min.js')
]}) To generate a custom env, use the command |
Sure, I can give this a try. |
https://harmony-docs.bit.dev/building-with-bit/environments/#customizing-environments or in the new docs (work in progress): https://teambit-community-apps-bit-dev.netlify.app/docs/envs/composing-env |
Awesome! Let me give this a try with the basic components which are working currently. Once the new build is available i will give the complex components a try as well. Thanks @ocombe for details around this and looking forward for more exciting Angular integrations. Cheers! |
I have published a new version with the fix |
Just wanted to confirm, should i try with teambit.angular/[email protected] or teambit.angular/[email protected] teambit.angular/[email protected] - This was the build version for your last fix. |
0.0.9 |
Sure, since the .bitmap still shows 0.0.8 for angular-v13 |
updated 🙂 |
Tested with Autocomplete component of material - FAILED https://material.angular.io/components/autocomplete/overview OS: Windows 10
|
Hmm |
ohh okay.. any possible timeline that we are looking at currently for this fix to be available if that can be shared? 👀 Just wanted to plan and prioritize things here accordingly 😊 as currently these material components wont work. |
I hope to release this change in the next 2 weeks if I don't hit any roadblock |
ok great, Thanks for sharing 🙌 oh and you said Similarly if we include Thoughts? 🤞 |
May be as below (Just giving it a try) In below file, Update
TO
and adding below 2 import statements on top,
|
@ocombe , any thoughts on above possible solution? Is it feasible? |
@ocombe , just checking on release of next Architecture changes for Angular elements which will fix above issue? Also, let me know if you got a chance to check on above mentioned possible solution? |
I will release a new version with the |
Sounds good, let me know once the new version is available and i will give it a try. Thanks! Do mention the version number to try with. |
|
sure, i will give this a try tomorrow morning and update. Thanks for the release! |
This is working fine with However the default material stylings are not getting applied which are breaking the components. I will try out the solution that you suggested by creating a custom environment using Will create separate issue in case of any errors in that process. @ocombe , Thank you for all the help! |
Getting below error when material components () are added,
The text was updated successfully, but these errors were encountered: