Cli-microsoft365: Bug report: Upgrade to 1.10.0 gives incomplete import suggestion to OUIFR

Created on 13 Mar 2020  ·  5Comments  ·  Source: pnp/cli-microsoft365

Description

Upgrade report suggests updating sass import to
@import '~office-ui-fabric-react/dist/sass/References.scss'

But this does not import the theme variables
Correct import should be
@import '~@microsoft/sp-office-ui-fabric-core/dist/sass/SPFabricCore.scss'

Steps to reproduce

Run command to generate upgrade report from 1.7.1 (version tested) to 1.10.0

Expected result

@import '~@microsoft/sp-office-ui-fabric-core/dist/sass/SPFabricCore.scss'

Actual result

@import '~office-ui-fabric-react/dist/sass/References.scss'

Environment

Windows
Bash
O365 CLI version: 2.7.0

bug

All 5 comments

I see on the rules that this was done intentionally, but being @microsoft/sp-office-ui-fabric-core the default source on projects, I wonder if it should not be kept as the default

This doesn't cause a build error but the variables are not imported, so in our case we only noticed it after the solution was deployed

Thanks @joelfmrodrigues. We'll have a look at it and see how to best tackle it 👍

Looking at projects generated using SPFx v1.9.1 and v1.10.0, they use @import '~office-ui-fabric-react/dist/sass/References.scss'; instead of @import '~@microsoft/sp-office-ui-fabric-core/dist/sass/SPFabricCore.scss';. As such, I'd say the upgrade guidance is correct and aligned with the projects generated by SPFx. If the project contents are incorrect, then perhaps we should raise it in sp-dev-docs as a separate issue.

@waldekmastykarz 🤦‍♂️ I should have created a new solution before adding the bug
Thanks and sorry for wasting your time testing it

Nah, don't worry about it. Better check twice than have a bug. Appreciate you reaching out ❤️

Was this page helpful?
0 / 5 - 0 ratings