WordPress / gutenberg-examples

Examples for extending WordPress/Gutenberg with blocks.
1.2k stars 316 forks source link

Can't Find index.asset.php #230

Closed ljdatasci closed 2 years ago

ljdatasci commented 2 years ago

In the Using the Wordpress Data Layer course, the file index.asset.php can't be found. I went through the steps in
Setting up your development environment, and when I ran npm start I got an error saying that the file build/index.asset.php can't be found. The code that uses the file is

$asset_file = include plugin_dir_path( __FILE__ ) 
.'build/index.asset.php';

foreach ( $asset_file['dependencies'] as $style ) {
    wp_enqueue_style( $style );
}

in the load_custom_wp_admin_scripts function in my-first-gutenberg-app.php

ljdatasci commented 2 years ago

Issue fixed by setting export NODE_ENV=development and then npm start again.