0

I have a serious issue with the files in my build directory after running the wp-scripts build command. None of them work when I try to run my plugin. The build directory used to have files along the lines of index.js, index.js.map, index.css, and index.css.map. Now, I have files that are named 134.css, 134.js, and 855.js, just to name a few. I still have index.js and can find the other files being referenced in index.js.

The problem is, when I uploaded the new files to my live site, it completely broke my plugin. I've reset the permalinks from the dashboard without success (trying anything at this point). If you go to this page, try clicking either the "Customize and Buy" or the "Order Sample" buttons and you'll see that nothing happens. Also, they look like normal buttons without any of my css. https://www.areapublic.com/product/willows/

This is a major issue for me and I really need this solved ASAP. I have updated all of my node modules, and this plugin does not rely on any other plugins to work. It has worked just fine with the current list of plugins. The site is using the most recent version of WordPress and should still work with the most recent modules that I updated today.

Please help!

Edited to add:

I have the following lines of code to load my build files on the site:

wp_enqueue_script('area-public-visualizer', plugin_dir_url(__FILE__) . 'build/index.js');
wp_enqueue_style('area-public-visualizer', plugin_dir_url(__FILE__) . 'build/index.css');

While I still have my index.js as mentioned earlier, I no longer have my index.css and no longer feel I can rely on the wp-scripts build command to not change the name of my css files in the future.

1 Answer 1

0

I actually just figured it out. I had my src/index.js waiting until the dom content loaded event fired. It had been working on previous versions, but for some reason the update that happened since I first built it no longer likes it. I had to remove the event listener on the window object. This got it to work as needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.