Error: *.default is not a constructor

烂漫一生 提交于 2019-12-03 09:20:22

You need to export a default value which will look like:

export default class MapAction implements IMapAction {...

And import it as:

import MapAction from './map_action_file';

Alternatively, if you want to export multiple things from the module you can do something like:

export class MapAction ...
export class MapSomethng ...

And import it as follows:

import { MapAction, MapSomething } from './map_action_file';

Check that your import is correct. you might miss {} for example.

import LatLngLiteral from '';

to

import { LatLngLiteral } from '';

Since classes in javascript are syntactic sugar, I figured I'd try to solve this issue without them. For me, switching the architecture over to prototypes seems to have solved my issue. Posting in case anyone else runs into this issue but is already doing export default

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!