Open wilecoyotegenius opened 2 months ago
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.
I have tried with 3.18.0 of the library, spfx 1.19.0 and node 18.18.2. This time it didn't even bundle correctly:
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 am desperate to get this one working, so if you have any solution ideas but lacking time to implement them, PM me and I'll do the hard work for you.
I @wilecoyotegenius i'll check this morning 🙂
@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...
Hi @wilecoyotegenius,
I made some tests on my side with the following results (Node version 18.20.3):
I also tried to npm link
local version of the Controls to the SPFx webpart 1.19 sample, without issue repro.
Regarding the webpack [object Object]
error, there's something on the tracks from SPFx gulp tools (it's not related to the Controls repo), hope to get this fixed soon.
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! The problem is this:
Generate by the latest versione of the "adaptive-expressions" 4.23.0
Now let me check how to resolve
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. I have created a pull request to lock down the package on 4.22.3
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!
adaptivecards-designer and adaptivecards-templating have both a peer dependency for adaptive-expressions set to ^4.11.0
.
If we remove adaptive-expressions from package.json, this will cause adaptive-expressions peer dependency resolve to latest (and breaking) version for adaptivecards-designer and adaptivecards-templating.
I made a following test:
Here's npm ls --depth=1
with adaptive-expressions in package.json
And here's, once I have uninstalled the package adaptive-expressions: adaptive-expressions are deduped into 4.23.1 version.
As expected, after uninstalling/removing adaptive-expressions from package.json, ControlsTest web part stopped working.
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
propertyexport interface IHelloWorldProps { description: string; isDarkTheme: boolean; environmentMessage: string; hasTeamsContext: boolean; userDisplayName: string; context: BaseComponentContext; }
... export default class HelloWorldWebPart extends BaseClientSideWebPart {
private _isDarkTheme: boolean = false; private _environmentMessage: string = '';
public render(): void { const element: React.ReactElement = React.createElement(
HelloWorld,
{
description: this.properties.description,
isDarkTheme: this._isDarkTheme,
environmentMessage: this._environmentMessage,
hasTeamsContext: !!this.context.sdks.microsoftTeams,
userDisplayName: this.context.pageContext.user.displayName,
context: this.context
}
);
} ...
import * as React from 'react'; import type { IHelloWorldProps } from './IHelloWorldProps'; import { AdaptiveCardHost } from "@pnp/spfx-controls-react/lib/AdaptiveCardHost";
export default class HelloWorld extends React.Component<IHelloWorldProps, {}> { public render(): React.ReactElement {
} }