Skip to content

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

Open
@menkeydyvh

Description

@menkeydyvh

前提:

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

主应用

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 的情况下什么原因会导致找不到?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions