Skip to content

Commit 7c34f41

Browse files
committed
Prevent production constant missing errors
1 parent 1981603 commit 7c34f41

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/interactivity/src/directives.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,11 @@ export default () => {
242242
if ( defaultEntry ) {
243243
const { namespace, value } = defaultEntry;
244244
// Check that the value is a JSON object. Send a console warning if not.
245-
if ( SCRIPT_DEBUG && ! isPlainObject( value ) ) {
245+
if (
246+
typeof SCRIPT_DEBUG !== 'undefined' &&
247+
SCRIPT_DEBUG === true &&
248+
! isPlainObject( value )
249+
) {
246250
// eslint-disable-next-line no-console
247251
console.warn(
248252
`The value of data-wp-context in "${ namespace }" store must be a valid stringified JSON object.`

0 commit comments

Comments
 (0)