Skip to content

theme file extension issue #412

@KingAmo

Description

@KingAmo

Describe the issue

react-strict-dom: 0.0.54

tokens.css.js

import { css } from 'react-strict-dom';

const DARK = '@media (prefers-color-scheme: dark)';

export const tokens = css.defineVars({
  red: 'red',
  opacity: css.types.number(0.5),
  fontSize: '30px',
  bg: {
    default: 'green',
    [DARK]: 'red',
  },
});

error in web:

Could not resolve the path to the imported file.
Please ensure that the theme file has a .stylex.js or .stylex.ts extension and follows the
rules for defining variables:

https://stylexjs.com/docs/learn/theming/defining-variables/#rules-when-defining-variables

Expected behavior

no error

Steps to reproduce

i am using react-strict-dom with vite, when upgrade react-strict-dom from 0.0.52 to 0.0.54, i come across this error

Test case

No response

Additional comments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions