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

dynamic.js:67 Uncaught TypeError: _this.load is not a function #2034

Closed
sydboys opened this issue Mar 16, 2019 · 2 comments
Closed

dynamic.js:67 Uncaught TypeError: _this.load is not a function #2034

sydboys opened this issue Mar 16, 2019 · 2 comments

Comments

@sydboys
Copy link

sydboys commented Mar 16, 2019

Code to reproduce the issue: (请提供可复现的代码或者步骤)

router.js

import React from 'react';
import { HashRouter as Router, Route, Switch } from 'dva/router';
import dynamic from 'dva/dynamic';

function RouterConfig({ app }) {
	const ProductsPage = dynamic({
		app,
		models: () => [],
		component: () => import('./pages/ProductsPage')
	});
	return (
		<Router>
			<Switch>
				<Route path="/" exact component={ProductsPage} />
			</Switch>
		</Router>
	);
}

export default RouterConfig;

Expected behavior: (预期的正常效果)

能加载模块

Actual behavior: (实际效果)

dynamic.js:67 
Uncaught TypeError: _this.load is not a function
react-dom.development.js:17071 
The above error occurred in the <DynamicComponent> component:
react-dom.development.js:20266
Uncaught TypeError: _this.load is not a function

Versions of packages used: (哪个库的哪个版本出现的问题)

dva 2.4.1
react 16.8.4 
react-dom 16.8.4
@sorrycc
Copy link
Member

sorrycc commented Mar 17, 2019

参考 #2032 (comment) 解决,相同的问题。

@sorrycc sorrycc closed this as completed Mar 17, 2019
@chaegumi
Copy link

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