-
Notifications
You must be signed in to change notification settings - Fork 9
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
switching between multiple embedded components seems buggy #361
Comments
Hello @sk-t3ch, The error message comes from the polyfill Solution would be to disable the polyfill in the bundles (https://nuxt-custom-elements.grabarzundpartner.dev/options/#polyfill). And if needed, build it directly into your page. |
Hey, maybe this occours because "destroyTimeout" property in vue-custom-element? I caught this same scenario during testing. Browsing between pages with multiple components, they start to get destroyed. |
Close the issue for now, but can be reopened if used. |
Hi there.
oh lord. Today isn't a good day. I was adding tag in wrong context. I'm sorry |
Can i see your working version, I stopped using it because of this problem |
https://github.com/sk-t3ch/t3chflicks-emoji-search/blob/master/src/widget/app/nuxt.config.js#L43 This is an open source project which uses it |
Reopen this issue for now 🙂 |
Hi sk-t3ch, I have added "polyfill: false" to customElements config, and also "destroyTimeout: null" in tags. But i don't know if destroyTimeout is really required in this case. Needs more tests. E.g nuxt.config.js
Also, polyfill is highly recommended because of compatibility between browsers, and this should be an temporarily workaround. |
thanks @rmarmitt, I will try that. @ThornWalli you mention
Sorry, I am inexperienced. How would this be done? Could you share a link to something similar? |
I meant that the polyfill is used on the target side. But it is also not nice... Yesterday I wanted to look at the problem again, unfortunately I don't get an example built so far. Question is whether you get even when initializing the polyfill with whether this is already set, so you could then block the import. nuxt-custom-elements/lib/tmpl/entry.js Lines 4 to 6 in a456a0b
|
Hey @ThornWalli, do you need an reproduction case? I can provide an repo with steps to reproduce the problem. But basically, create two pages, A and B, add the builded js on the target A and navigate between those pages multiple times (at least 3 times). You will see the bug. |
@sk-t3ch @rmarmitt There is an update on the Can you test this? 🙂 There are two changes:
nuxt-custom-elements/lib/utils/webpack.js Line 127 in 91fc1b5
nuxt-custom-elements/lib/utils/webpack.js Lines 140 to 143 in 91fc1b5
nuxt-custom-elements/lib/tmpl/entry.js Lines 4 to 9 in 91fc1b5
|
@ThornWalli I cannot find any pacakge with version "1.9.1-beta.2". If I install nuxt-custom-elements@beta, its getting Can you confirm if the build was generated and published? Also I have tried install targeting the branch |
Mmhhhh https://www.npmjs.com/package/nuxt-custom-elements/v/1.9.1-beta.2 The package must be installed via npm, is conditional on Husky...
|
This is rather strange now, even with What do you get with |
Lol. Even with With asap I will return with an feedback. Thank you very much :) |
@ThornWalli looks like the polyfill problem its solved 🚀 Just remember to keep "destroyTimeout: null" in tags, otherside the components will be destroyed after timeout. Idk why, but if you don't remove this property you will have problems with rendering. This is what the vue-custom-element documentation says: /*
in case of using vue-custom-element with modals, we destroy
it after defined timeout. Use "null" value if you want to manually "$destroy" it.
*/
destroyTimeout: 3000 |
@rmarmitt could you maybe build a small example that needs the Haven't had this problem yet and in my example with two different entries on two pages I have no problems. |
Fix is now in the |
Sure, I'll do it this weekend and let you know. |
Describe the bug
I have a few nuxt-custom-elements components embedded in my website (https://t3chflicks.org/Services) which are loaded from an external source (document-store.t3chflicks.org, medium-to-markdown.t3chflicks.org). When I switch page, loading a diferrent nuxt-custom-elements component, there seems to be odd behaviour:
To Reproduce
Steps to reproduce the behavior:
Sorry if this isnt enough informatio, please say if you would like an example project.
Cheers
The text was updated successfully, but these errors were encountered: