We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
i am using webpack 5 and when the web app is launched, the browser shows the following error
Uncaught SyntaxError: Cannot use 'import.meta' outside a module
currently, the output html has the following
<script defer src="vendors.0395f232202da9c00fd5.bundle.js"></script> <script defer src="main.0395f232202da9c00fd5.bundle.js"></script>
and what fix the issue is having type="module"
type="module"
<script defer src="vendors.0395f232202da9c00fd5.bundle.js"></script> <script defer src="main.0395f232202da9c00fd5.bundle.js" type="module"></script>
note that
There is no need to use the defer attribute (see <script> attributes) when loading a module script; modules are deferred automatically.
i used to leverage https://github.com/numical/script-ext-html-webpack-plugin to handle it
new ScriptExtHtmlWebpackPlugin({ module: "main", }),
but https://github.com/numical/script-ext-html-webpack-plugin has been deprecated and has no support for webpack 5. also tried setting the value "module" for the following configurations without any success:
"module"
how can type="module" be added? if the type="module" is not needed, how can i fix the issue?
The text was updated successfully, but these errors were encountered:
this has been added to the lastest version (5.5.0) thanks to @noppa #1672
Sorry, something went wrong.
No branches or pull requests
i am using webpack 5 and when the web app is launched, the browser shows the following error
currently, the output html has the following
and what fix the issue is having
type="module"
note that
i used to leverage https://github.com/numical/script-ext-html-webpack-plugin to handle it
but https://github.com/numical/script-ext-html-webpack-plugin has been deprecated and has no support for webpack 5. also tried setting the value
"module"
for the following configurations without any success:how can
type="module"
be added?if the
type="module"
is not needed, how can i fix the issue?The text was updated successfully, but these errors were encountered: