Skip to content
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

dev 模式加载 vite 子应用报错 Strict mode code may not include a with statement #2911

Open
lfzs opened this issue Feb 23, 2024 · 4 comments

Comments

@lfzs
Copy link

lfzs commented Feb 23, 2024

What happens?

dev 模式加载 vite 子应用报错 Strict mode code may not include a with statement

Mini Showcase Repository(REQUIRED)

https://github.com/lfzs/qiankun-rc19-vite

Context

  • qiankun Version: 3.0.0-rc.19
  • Platform Version: mac
  • Browser Version: chrome
@lfzs
Copy link
Author

lfzs commented Feb 23, 2024

vite ESM 不支持沙箱吗?

@lfzs
Copy link
Author

lfzs commented Feb 23, 2024

咨询遇到的两个问题:

  • vite 子应用应该如何 export 生命周期给主应用使用呢?
    在 main.js 中的 export 构建之后会被移除掉
    虽然 window[name] = { bootstrap, mount,unmount } 可以,但前提需要明确的 name

  • 子应用入口 script 文件需要 entry 标识,但是 vite 构建后会被移除,只能手动提供 plugin 进行添加吗?

@web-Hunter
Copy link

咨询遇到的两个问题:

  • vite 子应用应该如何 export 生命周期给主应用使用呢?
    在 main.js 中的 export 构建之后会被移除掉
    虽然 window[name] = { bootstrap, mount,unmount } 可以,但前提需要明确的 name
  • 子应用入口 script 文件需要 entry 标识,但是 vite 构建后会被移除,只能手动提供 plugin 进行添加吗?

作者的这个问题解决了吗

@jk4235
Copy link

jk4235 commented Apr 10, 2024

vite那个用不了吧, qiankun会自动包一层with,严格模式下不支持with语句的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants