-
Notifications
You must be signed in to change notification settings - Fork 795
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
bug: globalScript
not supporting async
#3392
Comments
Hey @mikaelkaron thanks for reporting this issue and for providing a repro! I was able to reproduce the issue and confirm that this is a bug in the code that Stencil uses to generate the relevant entry point. Ideally in this case Stencil would detect whether the |
Where is this at in your backlog? Any idea when the fix will be available?
|
@metsylvainlajoie happy to take a look! |
@mikaelkaron @metsylvainlajoie I raised a PR with a fix for this in #5158. However before we move on with this I would be interested in your use case here. Respecting an async function would mean that the screen would stay blank until the global script resolves. That seems to result in a bad user experience but I might have not enough context to understand in what way you are using global scripts. I want to make sure we are fixing the right problem at hand, Therefore can you elaborate how you use global scripts? Thanks a lot for providing more information. |
fixes #3392 STENCIL-467 PR feedback
* fix(compiler): support async globalScripts functions fixes #3392 STENCIL-467 PR feedback * remove unused file
A fix for this was included in today's v4.12.2 release! |
Hi Reits, great news and thank you for the update. We will merge the latest code and remove the “temporary” fixed we had in there until this! Thank you.
From: Tanner Reits ***@***.***>
Sent: Monday, February 12, 2024 11:52 AM
To: ionic-team/stencil ***@***.***>
Cc: Lajoie, Sylvain ***@***.***>; Mention ***@***.***>
Subject: [EXT] Re: [ionic-team/stencil] bug: `globalScript` not supporting `async` (Issue #3392)
CAUTION: This email originated from outside MetLife. Do not click links, open attachments or forward unless you recognize the sender and their email address and if you were expecting an email from them. If you suspect this email is phishing, report it by clicking on the Report Phishing button or forward it to ***@***.******@***.***>.
A fix for this was included in today's v4.12.2<https://github.com/ionic-team/stencil/releases/tag/v4.12.2> release!
—
Reply to this email directly, view it on GitHub<#3392 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AXST46XG54BWM7SR6JSZISTYTJCBPAVCNFSM5XKXZC52U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJTHEYTGNBZGQYQ>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
The information contained in this message may be CONFIDENTIAL and is for the intended addressee only. Any unauthorized use, dissemination of the information, or copying of this message is prohibited. If you are not the intended addressee, please notify the sender immediately and delete this message.
|
@tanner-reits I've not got to the bottom of it yet but I have a Stencil app that uses jeep-sqlite, which has started failing to run on the latest stencil version. By process of elimination I found this build (4.12.2) to be the problem, I'll hopefully get to the bottom of it, but something to do with how the custom elements are loaded onto the page seems to have changed |
Prerequisites
Stencil Version
2.15.2
Current Behavior
according to the
globalScript
documentation the exported method supportsasync
, however when testing this the bootstrapping is not_ async.With a little bit debugging I can see that the generated bootstrap methods won't
await
my code.Expected Behavior
That my
async
code is properlyawait
ed beforebootstrapLazy
is executedSteps to Reproduce
just export an
async
method inglobalScripts
file and put something incomponentDidLoad
on a component - check order of execution.I've done this in the reprocuction URL with four
console.log
statements.The expected order should be:
The current order:
Code Reproduction URL
https://codesandbox.io/s/stencil-globalscript-bug-r87gn2
Additional Information
No response
The text was updated successfully, but these errors were encountered: