-
Notifications
You must be signed in to change notification settings - Fork 379
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
AdaptiveCardHost not working for SPFx 1.18.2 (and later) #1876
Comments
Thanks for sharing! I'll check in the coming days |
I have just tested latest version of the library with following versions of spfx/node
None of the combinations work. |
Did one more test - cloned master branch of this repo and built it on node 18.18.2. ControlsTest web part from built into the library project failed to load with the same error as any of my projects. I can see that ControlsTest.tsx was last changed just 3 weeks ago. So it looks like it is working for other people (otherwise someone would have spotted the issue earlier). @michaelmaillot - I have noticed that you were the last one committing changes to ControlsTest.tsx. Will you be so kind and share your dev machine configuration (node version, etc.)? Maybe this issue is related to machine's config... |
Dear @fabiofranzini, have you had a chance to look at the issue? |
I @wilecoyotegenius i'll check this morning 🙂 |
I made some tests on my side with the following results (Node version 18.20.3):
I also tried to Regarding the webpack I couldn't figure out why this doesn't work on SPFx 1.19 except what explained before. Maybe @fabiofranzini will have a clue on the root cause. |
Thank you for looking at this @michaelmaillot, I have just started from scratch, with node 18.20.3, SPFx sample web part 1.18.2, PnP Controls 3.19 and it failed to work exactly the same way my previous tries did (with no errors during bundling or packaging). How is it possible that having the same configuration of an environment and project may lead to different bundles, of which one is working fine and other one does not? What am I missing? |
Hi @wilecoyotegenius I found the error! |
You're probably right @fabiofranzini, as my sample is referring to version 4.22.3 without encountering issues. Now that you mention it, maybe we should freeze the version of this package for stability? For now it's declared like this in the Controls: https://github.com/pnp/sp-dev-fx-controls-react/blob/master/package.json#L63 |
I have just tested and indeed all works fine, when "adaptive-expressions" is set to 4.22.3 and fails with 4.23.0. |
This update should be available in next beta release. Thanks again for finding the root cause @fabiofranzini & for the PR @wilecoyotegenius! |
We probably need to remove the reference to adaptive-expressions from package.json because it is never used anywhere in the project. The adaptive-expressions template has its own reference and is enough. This needs more tests of course! |
Category
[ ] Enhancement
[X ] Bug
[ ] Question
Version
Please specify what version of the library you are using: [ 3.19.0 ]
Expected / Desired Behavior / Question
AdaptiveHostControl does not work in projects using SPFx 1.18.2 and later. All works fine for various samples in sp-dev-fx-webparts repo, that use an older version of SPFx and node. Unfortunately, when trying to use the control on a brand new project, it fails miserably.
Observed Behavior
Whole web part using the control fails to load correctly.
Following error message may be found in the console:
Steps to Reproduce
My configuration:
node -v
v16.18.1 (but I have also used node 18.20.4 and 18.17.1 with no success)
npm -v
8.19.2
Scaffold new web part project. Used React as framework, remaining questions answered with defaults.
yo @microsoft/sharepoint
Add latest @pnp/spfx-controls-react package
npm i @pnp/spfx-controls-react
Extend IHelloWorldProps.ts by
context
propertyrender
method in HelloWorldWebPart.ts code to pass context to the componentBuild the package and drop it to App Catalog.
gulp build
gulp bundle --ship
gulp package-solution --ship
Add an App to the site. No issues at any point,
Add the webpart to a page. Web part fails to render. What is interesting, it's not even hitting debugger in the web part's
onInit
orrender
methods. So it's like the whole bundle is broken... The moment I comment out AdaptiveCardHost from the component all starts working fine.Has anyone else observed this behavior?
The text was updated successfully, but these errors were encountered: