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

Gutenberg SDK: Importing "loadScript" Library Into Block Fails #27821

Closed
jeffersonrabb opened this issue Oct 12, 2018 · 1 comment
Closed

Gutenberg SDK: Importing "loadScript" Library Into Block Fails #27821

jeffersonrabb opened this issue Oct 12, 2018 · 1 comment
Assignees

Comments

@jeffersonrabb
Copy link
Contributor

jeffersonrabb commented Oct 12, 2018

Steps to reproduce

  1. Add the following import to the editor.js file of any block found in client/gutenberg/extensions: import { loadScript } from 'lib/load-script';
  2. Build the block using the SDK, e.g.: npm run sdk gutenberg client/gutenberg/extensions/presets/jetpack -- --output-dir=PATH_TO_JETPACK_REPO/_inc/blocks
  3. The SDK should build successfully with no errors.
  4. Add the block to a post in a browser. You should see the following error in the Javascript console:

https://d.pr/free/i/C00g4r

What I expected

Library would be successfully imported and useable within the block.

Browser / OS version

Chrome Version 69.0.3497.100 (Official Build) (64-bit) / macOS High Sierra 10.13.6

jeffersonrabb added a commit that referenced this issue Oct 12, 2018
… load Google Maps library. Will use version found in client/lib after resolution of #27821.
jeffersonrabb added a commit that referenced this issue Oct 23, 2018
… load Google Maps library. Will use version found in client/lib after resolution of #27821.
jeffersonrabb added a commit that referenced this issue Nov 13, 2018
… load Google Maps library. Will use version found in client/lib after resolution of #27821.
@jeffersonrabb
Copy link
Contributor Author

No longer relevant, as we've been using Webpack Dynamic Imports instead.

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

No branches or pull requests

2 participants