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

vite打包后的应用一直读取不到 mount #759

Open
menkeydyvh opened this issue Nov 13, 2024 · 1 comment
Open

vite打包后的应用一直读取不到 mount #759

menkeydyvh opened this issue Nov 13, 2024 · 1 comment

Comments

@menkeydyvh
Copy link

前提:

以下在 (本地开发运行) 的时候都是能正常访问,且主应用加载子应用是能正常访问
异常主要出现在打包后,主应用来加载子应用时出现的错误

主应用

ice应用

异常信息:

    apps.js:287 TypeError: Cannot read properties of null (reading 'mount')
    at apps.js:226:1
    at Array.forEach (<anonymous>)
    at combineLifecyle (apps.js:225:1)
    at apps.js:197:1
    at step (apps.js:43:1)
    at Object.next (apps.js:24:1)
    at fulfilled (apps.js:15:1)

主应用有配置

loadScriptMode: "import"

子应用

vite5 应用

入口main.js有暴露mount,和unmount

....
export {
    mount,
    unmount,
}

主要是开发运行的时候是可以正常加载的 打包后出现的问题?不懂是哪边的情况!而且这个问题明显是找不到mount。
在有export mount 的情况下什么原因会导致找不到?

@ClarkXia
Copy link
Collaborator

可以试试在 Console 控制台直接通过 import('https://your.js.scripts').then((mod) => { console.log(mod) }) 的方式,确认下是不是有生命周期的导出

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

2 participants