stylex_constants/constants/evaluation_errors.rs
1// pub static IMPORT_FILE_PARSING_ERROR: &str = r#"There was error when attempting to parse the imported file.
2// Please ensure that the 'babelrc' file is configured to be able to parse this file."#;
3
4// pub static IMPORT_FILE_EVAL_ERROR: &str = r#"There was an error when attempting to evaluate the imported file.
5// Please ensure that the imported file is self-contained and does not rely on dynamic behavior."#;
6
7// pub static DEFAULT_IMPORT: &str = r#"Error: Cannot use default imports.
8
9// Please define your styles without depending on values imported from other files.
10
11// You *may* use named imports to use variables defined with `defineVars` in a file with `.stylex.js` or `.stylex.ts` file.
12// See: https://stylexjs.com/docs/learn/theming/defining-variables/#rules-when-defining-variables for more information."#;
13
14pub static PATH_WITHOUT_NODE: &str = r#"Unexpected error:
15Could not resolve the code being evaluated."#;
16
17pub static UNEXPECTED_MEMBER_LOOKUP: &str = r#"Unexpected error:
18Could not determine the property being accessed."#;
19
20pub static IMPORT_PATH_RESOLUTION_ERROR: &str = r#"Could not resolve the path to the imported file.
21Please ensure that the theme file has a .stylex.js or .stylex.ts extension and follows the
22rules for defining variables:
23
24https://stylexjs.com/docs/learn/theming/defining-variables/#rules-when-defining-variables
25"#;
26
27pub static NON_CONSTANT: &str = "Referenced value is not a constant.\n\n";
28
29// pub static USED_BEFORE_DECLARATION: &str =
30// "Referenced value is used before declaration.\n\n";
31
32// pub static UNINITIALIZED_CONST: &str = "Referenced constant is not initialized.\n\n";
33
34pub static UNDEFINED_CONST: &str = "Referenced constant is not defined.";
35
36pub static OBJECT_METHOD: &str = "Unsupported object method.\n\n";
37
38pub fn unsupported_operator(op: &str) -> String {
39 format!("Unsupported operator: {}\n\n", op)
40}
41
42pub fn unsupported_expression(type_: &str) -> String {
43 format!("Unsupported expression: {}\n\n", type_)
44}