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

3rd party fails to load on second pageload #356

Open
Ornhoj opened this issue Feb 5, 2019 · 0 comments
Open

3rd party fails to load on second pageload #356

Ornhoj opened this issue Feb 5, 2019 · 0 comments

Comments

@Ornhoj
Copy link

Ornhoj commented Feb 5, 2019

Hi @yyx990803
Some service integrations require an embedded script inside the vue instance. This is per default not allowed, but with packages like vue-script2 it is possible - however.

Integrating a third party script inside the vue instance will only allow it to load on the first page load both SSR loaded and CSR. The only way I have found to hack this issue is to apply some information about the current page contains a "unsupported" script and force a SSR by window.location.replace in the beforeRouteUpdate navigation guard.

Is there a way to implement third party scripts provided by some companies, that will load every time?

I have used the following as a base for testing in both in Vue CLI and Vue-Hackernews 2.0 boilerplate.

<div data-widget-url="https://septima.dk/widget/config/layer.json"></div>
<script src="https://widgetconfig.septima.dk/widgetconfig.js"></script>

This perticular case can be hacked but the issue still prevails if only a script-tag is provided which has to be placed in context.

I personally see this as a missing part of Vue if my case is unsupported.

Cheers

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