You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can see that in 6be8e44 changes to silence warnings about the use of import with non-string literals inside try/catch blocks were added, however the rules apply only if the call is used with async/await, from the commit:
// this silences the warnings
async function main(name) {
try {
return await import(name)
} catch {
}
}
main('fs')
// this doesn't
async function main(name) {
try {
return import(name)
} catch {
}
}
main('fs')
so far it makes sense, however, I believe that the following code should also silence the warnings:
function main(name) {
import(name)
.then(mod => { // do stuff })
.catch(e => { // do stuff })
}
main('fs')
Thanks for the awesome tool!
The text was updated successfully, but these errors were encountered:
darionco
changed the title
Handling import() errors through .catch() doesn't silence bindling warnings.
Handling import() errors through .catch() doesn't silence bundling warnings.
Feb 26, 2021
Hi,
I can see that in 6be8e44 changes to silence warnings about the use of
import
with non-string literals insidetry/catch
blocks were added, however the rules apply only if the call is used withasync
/await
, from the commit:so far it makes sense, however, I believe that the following code should also silence the warnings:
Thanks for the awesome tool!
The text was updated successfully, but these errors were encountered: