@@ -28,32 +28,32 @@ const getClassNameForNamespacedStyleName = (
28
28
29
29
if ( ! moduleName ) {
30
30
if ( handleMissingStyleName === 'throw' ) {
31
- throw new Error ( 'Invalid style name.' ) ;
31
+ throw new Error ( 'Invalid style name: ' + styleName ) ;
32
32
} else if ( handleMissingStyleName === 'warn' ) {
33
33
// eslint-disable-next-line no-console
34
- console . warn ( 'Invalid style name.' ) ;
34
+ console . warn ( 'Invalid style name: ' + styleName ) ;
35
35
} else {
36
36
return null ;
37
37
}
38
38
}
39
39
40
40
if ( ! styleModuleImportMap [ importName ] ) {
41
41
if ( handleMissingStyleName === 'throw' ) {
42
- throw new Error ( 'CSS module import does not exist.' ) ;
42
+ throw new Error ( 'CSS module import does not exist: ' + importName ) ;
43
43
} else if ( handleMissingStyleName === 'warn' ) {
44
44
// eslint-disable-next-line no-console
45
- console . warn ( 'CSS module import does not exist.' ) ;
45
+ console . warn ( 'CSS module import does not exist: ' + importName ) ;
46
46
} else {
47
47
return null ;
48
48
}
49
49
}
50
50
51
51
if ( ! styleModuleImportMap [ importName ] [ moduleName ] ) {
52
52
if ( handleMissingStyleName === 'throw' ) {
53
- throw new Error ( 'CSS module does not exist.' ) ;
53
+ throw new Error ( 'CSS module does not exist: ' + moduleName ) ;
54
54
} else if ( handleMissingStyleName === 'warn' ) {
55
55
// eslint-disable-next-line no-console
56
- console . warn ( 'CSS module does not exist.' ) ;
56
+ console . warn ( 'CSS module does not exist: ' + moduleName ) ;
57
57
} else {
58
58
return null ;
59
59
}
@@ -83,11 +83,13 @@ export default (styleNameValue: string, styleModuleImportMap: StyleModuleImportM
83
83
}
84
84
85
85
if ( styleModuleImportMapKeys . length === 0 ) {
86
- throw new Error ( 'Cannot use styleName attribute without importing at least one stylesheet.' ) ;
86
+ throw new Error ( 'Cannot use styleName attribute for style name \'' + styleName +
87
+ '\' without importing at least one stylesheet.' ) ;
87
88
}
88
89
89
90
if ( styleModuleImportMapKeys . length > 1 ) {
90
- throw new Error ( 'Cannot use anonymous style name with more than one stylesheet import.' ) ;
91
+ throw new Error ( 'Cannot use anonymous style name \'' + styleName +
92
+ '\' with more than one stylesheet import.' ) ;
91
93
}
92
94
93
95
const styleModuleMap : StyleModuleMapType = styleModuleImportMap [ styleModuleImportMapKeys [ 0 ] ] ;
0 commit comments