Registry /
web-framework / asma-qiankun-plugin-vite
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–223 runs
build_error
glibcnode 18–223 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
qiankun
✓ import { qiankun } from 'asma-qiankun-plugin-vite';
✗ import qiankun from 'asma-qiankun-plugin-vite';
qiankun is a named export, not default.
generateQiankunHelpers
✓ import { generateQiankunHelpers } from 'asma-qiankun-plugin-vite/helper';
✗ import { generateQiankunHelpers } from 'asma-qiankun-plugin-vite';
Helpers are exported from the submodule 'helper', not main entry.
qiankunWindow
✓ import { generateQiankunHelpers } from 'asma-qiankun-plugin-vite/helper'; const { qiankunWindow } = generateQiankunHelpers('appName');
✗ import { qiankunWindow } from 'asma-qiankun-plugin-vite/helper';
qiankunWindow is not a direct export; you must call generateQiankunHelpers to obtain it.
Configures Vite with the qiankun plugin, then sets up Qiankun lifecycle hooks and conditional rendering based on sandbox flag.
// vite.config.ts
import { qiankun } from 'asma-qiankun-plugin-vite';
export default {
plugins: [qiankun('myMicroAppName')],
base: 'http://xxx.com/'
}
// main.ts
import { generateQiankunHelpers } from 'asma-qiankun-plugin-vite/helper';
const { renderWithQiankun, qiankunWindow } = generateQiankunHelpers('myMicroAppName');
renderWithQiankun({
mount(props) {
console.log('mount');
const { container } = props;
const root = container?.querySelector('#root') || document.querySelector('#root');
ReactDOM.render(<App />, root);
},
bootstrap() { console.log('bootstrap'); },
unmount(props: any) {
const { container } = props;
const root = container?.querySelector('#root') || document.querySelector('#root');
ReactDOM.unmountComponentAtNode(root);
},
});
if (!qiankunWindow.__POWERED_BY_QIANKUN__) {
ReactDOM.render(<App />, document.querySelector('#root'));
}
Errors
Common errors & fixes
Cannot find module 'asma-qiankun-plugin-vite/helper'
Import path does not include '/helper' or module resolution is misconfigured.
fixUse import { generateQiankunHelpers } from 'asma-qiankun-plugin-vite/helper' (note the subpath). TypeError: qiankun is not a function
Default import used instead of named import.
fixUse import { qiankun } from 'asma-qiankun-plugin-vite' (curly braces). Uncaught TypeError: Cannot set properties of undefined (setting 'customxxx')
qiankunWindow is undefined because generateQiankunHelpers was not called or incorrect import path.
fixEnsure correct import and invocation: const { qiankunWindow } = generateQiankunHelpers('myMicroAppName'); then use qiankunWindow.customxxx = 'ssss'. Audit
Dependencies
viterequiredPeer dependency: plugin hooks into Vite's build and dev server.
typescriptoptionalPeer dependency: plugin ships TypeScript types and requires TS >=4 for compilation.