theron-wang/VS2022-Editor-Support-for-Tailwind-CSS

Tailwind extension error when using fontFamily

BowserKingKoopa opened this issue · 4 comments

The extension gets stuck on 'Reloading Tailwind CSS configuration for me whenever I have a 'fontFamily' in my config.

/** @type {import('tailwindcss').Config} */
module.exports =
{
    content: ["./**/*.cshtml"],
    theme:
    {
        extend:
        {
            fontFamily: {
                'nunito': ['nunito', 'sans-serif']
            },
            colors:
            {
                'trippieblue': '#3095f4'
            },
        }
    },
    plugins: [],
}

The error printed to the console when Visual Studio starts up is:
System.InvalidOperationException: Sequence contains no elements
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
at TailwindCSSIntellisense.Configuration.CompletionConfiguration.LoadIndividualConfigurationExtend(TailwindConfiguration config)
at TailwindCSSIntellisense.Configuration.CompletionConfiguration.d__34.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at TailwindCSSIntellisense.Completions.CompletionUtilities.d__64.MoveNext()

If I remove the 'fontFamily' part of the config everything works normally.

One other note. It seems like if I add the fontFamily config while Visual Studio is already running and my project is open and I'm in the middle of working, it works. Only when I close and restart it, with fontFamily already in the config, does the above error appear (and if the error appears the Intellisense no longer works).

I've found a fix for this and I'll include it in the next extension update (I'll close this issue once I release it).

Thanks for reporting the bug!

Thank you. And thank you so much for this Extension!

Thank you. And thank you so much for this Extension!

No problem :)! I've also just released the update which should fix the error. Also - the description for font-nunito will be incorrect in IntelliSense for now; I will fix that in a future update.