Skip to content

Fallback warnings only show in dev, not prod/CI #19

@marklearst

Description

@marklearst

Problem:
Invalid fallback handling is silent in production/CI, which can hide failures in static builds or Storybook. Warnings should be visible in all environments for better debugging.

References:

  • src/contexts/FigmaVarsProvider.tsx

Citations:

  • src/contexts/FigmaVarsProvider.tsx

Code Snippets

src/contexts/FigmaVarsProvider.tsx:

// Invalid structure - log warning but don't crash
if (process.env.NODE_ENV !== 'production') {
  console.warn('[figma-vars-hooks] fallbackFile object does not match expected Figma Variables API response structure. ...')
}

tests/FigmaVarsProvider.test.tsx:

it('does not log warnings in production mode for invalid fallback', () => {
  process.env.NODE_ENV = 'production'
  // ... 
  expect(console.warn).not.toHaveBeenCalled()
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions