You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`Message at \`${message.id}\` resolved to an array, but only strings are supported. See https://next-intl.dev/docs/usage/translations#arrays-of-messages`
117
+
);
118
+
}
119
+
120
+
if(typeofmessageValue==='object'){
121
+
thrownewError(
122
+
`Message at \`${message.id}\` resolved to \`${typeofmessageValue}\`, but only strings are supported. Use a \`.\` to retrieve nested messages. See https://next-intl.dev/docs/usage/translations#structuring-messages`
123
+
);
124
+
}
125
+
}
126
+
85
127
/**
86
128
* Recursively precompiles all ICU message strings in a messages object
87
129
* using icu-minify/compile for smaller runtime bundles.
@@ -95,20 +137,9 @@ function precompileMessages(
95
137
96
138
for(constmessageofmessages){
97
139
cacheKeysToEvict.delete(message.id);
140
+
assertStringMessage(message);
98
141
constmessageValue=message.message;
99
142
100
-
if(Array.isArray(messageValue)){
101
-
thrownewError(
102
-
`Message at \`${message.id}\` resolved to an array, but only strings are supported. See https://next-intl.dev/docs/usage/translations#arrays-of-messages`
103
-
);
104
-
}
105
-
106
-
if(typeofmessageValue==='object'){
107
-
thrownewError(
108
-
`Message at \`${message.id}\` resolved to \`${typeofmessageValue}\`, but only strings are supported. Use a \`.\` to retrieve nested messages. See https://next-intl.dev/docs/usage/translations#structuring-messages`
0 commit comments