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
fix: do not warn (about not being able to bundle non module scripts) when src is an external url #7380
Conversation
…when src is an external url Example of script tag in /index.html causing following warning: <script src="https://www.googletagmanager.com/gtag/js?id=..."> in "/index.html" can't be bundled without type="module" attribute
Cheers from the Quasar Team! |
config.logger.warn( | ||
`<script src="${url}"> in "${publicPath}" can't be bundled without type="module" attribute` | ||
) | ||
if (!isExcludedUrl(url)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been on my to-fix list for a long while. Thanks for fixing this 😄
My only concern with this is that isExcludedUrl
also runs checkPublicFile
, which is already covered by isPublicFile
. But given this warning don't always happen, I think it's still fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bluwy I thought it was too much to create a new function similar to isExcludedUrl() but without the checkPublicFile() call. Felt more like duplicating code than optimization. However, should you guys want to, I can create a new PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine the way it is now 👍
Honestly, thanks for the fix. I've been seeing this error and I can't help but feel like something is broken in my code. Stupid question 😅: How do I update so the fix can take effect? @bluwy I ran vite version: |
You can use vite@2.9.0-beta.4, or wait until 2.9 is released |
Oh... Many thanks. 🙏🏾 |
@patak-dev Hey guy, I had met the same issue in vite v3.2.5 |
@dh336699 please try with Vite's latest version and if you find a regression, create a new issue with a minimal reproduction. Thanks! |
@patak-dev Thanks for your reply, our project was based on Vben. |
That isn't how reports are tracked and resolved. If you can reproduce it without VBen, create an issue with a minimal reproduction. If not, create an issue in the VBen repo. |
Description
Do not warn (about not being able to bundle non module scripts injected into /index.html) when src is an external url.
Additional context
Example of script tag in /index.html causing following warning:
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).