DEV Community

Riccardo Gregori
Riccardo Gregori

Posted on

PCF's default Fluent UI version is broken... and how to fix it

If you build PCF (Power Apps Component Framework) controls for Dynamics 365 / Power Platform, there's a very good chance you've already hit this wall — or you will, the next time you spin up a new control. It's one of those small, infuriating papercuts that has nothing to do with your code and everything to do with the tooling assuming things about your target environment that simply aren't true.

Let me walk you through it.

⚙️ The Setup

You do what the docs tell you to do. You open a terminal, you run:

pac pcf init --namespace MyNamespace --name MyControl --template field
Enter fullscreen mode Exit fullscreen mode

(or --template dataset, it doesn't matter — the bug is template-agnostic).

The CLI happily scaffolds the project for you: index.ts, ControlManifest.Input.xml, package.json, the tsconfig, the lot. You write your control, you test it locally with npm start, everything looks great. You're feeling productive.

Now look at what the scaffolding generated for the Fluent UI dependency.

In ControlManifest.Input.xml:

<platform-library name="Fluent" version="9.68.0" />
Enter fullscreen mode Exit fullscreen mode

In package.json:

"@fluentui/react-components": "9.68.0",
Enter fullscreen mode Exit fullscreen mode

Both files agree. The CLI is internally consistent. Surely Microsoft's own tool wouldn't hand you a default that doesn't work… right?

❌ The Crash

You package the control into a solution (managed or unmanaged, doesn't matter), you push it to your target environment, and the import blows up:

Error: Import Solution Failed: CustomControl with name  failed to import with error:
CustomControls with Name <YourControlName> Import Solution Failed with following error:
platform library fluent_9_68_0 with version 9.68.0 is not supported by the platform.
Enter fullscreen mode Exit fullscreen mode

😠🤬 The version the CLI just generated for you, two minutes ago, isn't the version actually supported by the platform.

🔨 The Fix

You need to manually downgrade Fluent in both places to a version the platform actually accepts. At the time of writing, the version that works for me is 9.46.2.

So ControlManifest.Input.xml becomes:

<platform-library name="Fluent" version="9.46.2" />
Enter fullscreen mode Exit fullscreen mode

And package.json becomes:

"@fluentui/react-components": "9.46.2",
Enter fullscreen mode Exit fullscreen mode

Then npm install, rebuild, repackage, reimport.

🧐 Takeaways

  • Don't trust the scaffolded Fluent version. As soon as pac pcf init finishes, check ControlManifest.Input.xml and package.json, and swap the version to one your environment actually supports.
  • Keep both files in sync. They have to match, or you'll get a different — equally cryptic — error at build or runtime.
  • 9.46.2 is a known-good value for me right now. Yours may differ depending on what your target environment has rolled out; the safest move is to check what other working controls in your tenant declare and copy that.
  • If you maintain a starter template / yeoman generator / project scaffold at your company, hard-code the Fluent version there and stop relying on the CLI's default. You'll save every junior dev on your team a half-day of debugging.

It's a small thing. But it's a small thing that has tripped me up on every single PCF I have ever created, and judging by the volume of forum posts on the subject, I'm very much not alone.

Fingers crossed that Microsoft will fix this soon, so that the next dev running pac pcf init gets a project that just works.

Top comments (0)