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

Extensions: Jetpack blocks disappear when ActiveCampaign plugin is activated #17289

Closed
creativecoder opened this issue Sep 28, 2020 · 8 comments · Fixed by #17312
Closed

Extensions: Jetpack blocks disappear when ActiveCampaign plugin is activated #17289

creativecoder opened this issue Sep 28, 2020 · 8 comments · Fixed by #17312
Assignees
Labels
[Extension] Social Previews Social Preview block editor plugin [Pri] Normal [Type] Bug When a feature is broken and / or not performing as intended

Comments

@creativecoder
Copy link
Contributor

creativecoder commented Sep 28, 2020

Steps to reproduce the issue

  1. On a connected Jetpack Site
  2. Purchase a "Jetpack Complete" plan, if the site doesn't already have one
  3. Enable experimental blocks -- define( 'JETPACK_EXPERIMENTAL_BLOCKS', true ); in wp-config.php
  4. Enable SEO Tools module in Calypso -- https://wordpress.com/marketing/traffic/{site}
  5. Verify that you can see the "SEO description" input in the editor sidebar
  6. Then activate the ActiveCampaign plugin
  7. Load a post in the editor

What I expected

  1. All Jetpack blocks to be available

What happened instead

  1. No Jetpack blocks are available
  2. There's a js error in editor-experimental.js

Screenshots

Screen Shot 2020-09-28 at 14 41 53

Screen Shot 2020-09-28 at 14 46 41

Screen Shot 2020-09-28 at 14 47 15

@creativecoder creativecoder added [Type] Bug When a feature is broken and / or not performing as intended [Feature] SEO Tools Tools for improving a site's search engine optimization. [Pri] High labels Sep 28, 2020
@jeherve jeherve added [Extensions] Social Previews [Pri] Normal and removed [Feature] SEO Tools Tools for improving a site's search engine optimization. [Pri] High labels Sep 29, 2020
@jeherve
Copy link
Member

jeherve commented Sep 29, 2020

This seems to happen to me even when the SEO Tools module is disabled, and even with the Production blocks. The error points to the Social Previews extension, and not SEO tools:

{
value: DATE_RANGE_CUSTOM,
label: __( 'Specific Month/Year', 'jetpack' ),
},

On my end, the error actually is a few lines downer:

image

@creativecoder
Copy link
Contributor Author

You're right about the source--my screenshot is in Firefox, looks like Chrome wins the prettifying minified js in this case.

To see what would happen, I removed lodash as a dependency from that file. It triggered the same error elsewhere.

I did a little digging, I still don't totally understand what's going on, but I can see that activating the ActiveCampaign plugin makes lodash disappear for editor-experimental.js (and maybe elsewhere?)

ActiveCampaign active ActiveCampaign inactive
Screen Shot 2020-09-29 at 17 51 52 Screen Shot 2020-09-29 at 17 51 29

@jeherve
Copy link
Member

jeherve commented Sep 30, 2020

I can see that activating the ActiveCampaign plugin makes lodash disappear for editor-experimental.js

I couldn't find the ActiveCampaign plugin on GitHub to check its source code. Maybe we could reach out to them, maybe they do something to dequeue or modify the copy of lodash that comes bundled with WordPress and is used here?

@creativecoder
Copy link
Contributor Author

I think I found the issue, a conflict with window.webpackJsonp in the webpack builds of Jetpack blocks and the ActiveCampaign block. It looks like this has happened up with other plugins.

The webpack docs state

If multiple webpack runtimes (from different compilations) are used on the same webpage, there is a risk of conflicts of on-demand chunks in the global namespace.

If someone more versed in Jetpack webpack config can help me set the output.jsonpFunction setting to a custom value (at least for blocks, if not all transpiled Jetpack JS), I think that will resolve this.

@creativecoder
Copy link
Contributor Author

Here's my first attempt, which didn't seem to work (the jsonp global name does not change)

33815b4

@jeherve
Copy link
Member

jeherve commented Oct 7, 2020

@jeherve
Copy link
Member

jeherve commented Oct 7, 2020

@creativecoder
Copy link
Contributor Author

Now I see that the calypso-build package needs to be updated to support customizing the config for output.jsonpFunction in order to customize this.

PR: Automattic/wp-calypso#46252

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Extension] Social Previews Social Preview block editor plugin [Pri] Normal [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants