Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"non-block-examples/09-code-data-basics-esnext" -> cannot run example: "Loading failed for the <script> with source “http://localhost:10033/wp-content/plugins/gtb-app/index.js?ver=2a64c5472c20f7b85e7a”." #251

Open
karstengresch opened this issue Apr 19, 2023 · 0 comments

Comments

@karstengresch
Copy link

Hi all,

  • System Version: macOS 13.3.1 (22E261)
  • Kernel Version: Darwin 22.4.0
  • PHP Version 8.1.9
  • WordPress 6.2
  • MySQL 8.0.16
  • Running on Local 6.7.0+6347
  • Firefox 111.0.1

I tried to follow along the example from https://developer.wordpress.org/block-editor/how-to-guides/data-basics/ using the plugin directory gtp-app. As I encountered the error described later, I replaced all files with the ones from GitHub and ran the build steps again with no success.

Used npm install npm run start and everything seems to work fine:

> [email protected] start
> wp-scripts start

asset index.js 19 KiB [emitted] (name: index) 1 related asset
asset index.asset.php 174 bytes [emitted] (name: index)
Entrypoint index 19.1 KiB (19.9 KiB) = index.js 19 KiB index.asset.php 174 bytes 1 auxiliary asset
runtime modules 997 bytes 4 modules
built modules 8.45 KiB [built]
  ./src/index.js 8.2 KiB [built] [code generated]
  external ["wp","element"] 42 bytes [built] [code generated]
  external ["wp","components"] 42 bytes [built] [code generated]
  external ["wp","coreData"] 42 bytes [built] [code generated]
  external ["wp","data"] 42 bytes [built] [code generated]
  external ["wp","htmlEntities"] 42 bytes [built] [code generated]
  external ["wp","notices"] 42 bytes [built] [code generated]
webpack 5.79.0 compiled successfully in 421 ms

The problem is that basically the src/index.js isn't loading and thus the components aren't shown.

In the dev console, I get this error message:

Loading failed for the <script> with source “http://localhost:10033/wp-content/plugins/gtb-app/index.js?ver=2a64c5472c20f7b85e7a”.

The version string comes from build/index.asset.php:

<?php return array('dependencies' => array('wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-notices'), 'version' => '7de8fda5143cd9a81193');

Not sure, but maybe the doc or the example (or my setup [or I ;-| ] need to be fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant