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

VM3 admin-ajax.php:1 Uncaught SyntaxError: Unexpected token '<' #315

Closed
Stanzilla opened this issue Jul 22, 2020 · 4 comments
Closed

VM3 admin-ajax.php:1 Uncaught SyntaxError: Unexpected token '<' #315

Stanzilla opened this issue Jul 22, 2020 · 4 comments
Labels
duplicate This issue or pull request already exists

Comments

@Stanzilla
Copy link

Only getting this when the PWA plugin is enabled

VM29179 plugins.php:1 Uncaught (in promise) TypeError: Failed to register a ServiceWorker for scope ('https://learn.coregames.com/wp-admin/') with script ('https://learn.coregames.com/wp-admin/admin-ajax.php?action=wp_service_worker'): ServiceWorker script evaluation failed

assume this might be fixed with the future work of making a separate SW for the admin panel but wanted to report it anyway

@westonruter
Copy link
Collaborator

Can you share the full output of the service worker script, like in a Gist? You may be experiencing this issue: #293

@Stanzilla
Copy link
Author

@westonruter westonruter added the duplicate This issue or pull request already exists label Jul 22, 2020
@westonruter
Copy link
Collaborator

OK, yeah. See the <style class="astra-menu-appearance-style">...</style>? That's a bug in Astra where the theme is incorrectly printing styles at wp_enqueue_scripts (or admin_enqueue_scripts) rather than strictly enqueueing scripts/styles. They should rather be using the wp_print_styles action (or equivalent admin action). So first I recommend reporting this as a bug to Astra, but the PWA plugin will also prevent this from happening in #293.

@Stanzilla
Copy link
Author

Awesome, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants