-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Is it possible to load a sub app using type="module"
script tag when the master app doesn't use type="module"
script tag
#756
Comments
type="module
script tag when the master app doesn't use type="module
script tagtype="module"
script tag when the master app doesn't use type="module"
script tag
Not quite understand what you mean, sorry ~. |
e.g. Master app: a regular app created by Sub app: built without builders, only some static files: index.html <!DOCTYPE html>
<html lang="en">
<head></head>
<body>
<script type="module" src="/a.js"></script>
</body>
</html> a.js import { foo } from '/b.js';
console.log(foo); b.js export const foo = 'Hello World'; |
@kuitos I have a similar question. I built a Vue3 subapplication using Vite. And the subapplication page has wrote "<script type="module" src="//localhost:3000/main.js" entry></script>"。 But the console keeps reporting errors. "Cannot use Import Statement outside a Module" |
+1 |
I have same question.Have you solved it?thank :) |
@lalaze Not yet, still waiting for responses from maintainers. |
It's been almost a year. Haven't you supported it yet. |
This is the reason why qiankun is unable to load html with Fotunately |
So what is the workaround? |
Is it possible to load a sub app using
type="module
script tag when the master app doesn't usetype="module
script tag?After some researching I found it seems currently qiankun uses
eval
to execute scripts of sub apps viaimport-html-entry
module, which means when the javascript context of the master app isn't a module, the javascript context of sub apps can't use module syntax either, which is a big limitation in MICRO FRONTEND architecture.I wonder if it's possible to use any other ways to executing scripts instead of using
eval
, e.g. inserting a inline script element to the sub app?The text was updated successfully, but these errors were encountered: