键入错误“模块的默认导出具有或正在使用私有名称". -从打字稿v1.8切换到2 [英] Typing error "Default export of the module has or is using private name" - switch from typescript v1.8 to 2

查看:866
本文介绍了键入错误“模块的默认导出具有或正在使用私有名称". -从打字稿v1.8切换到2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将离子应用程序从Beta 11更新为rc0.因此,这意味着我已经从angular2 rc4切换到稳定的angular2,并且从打字稿1.8切换到了2.

我有一个redux架构,正在使用Redux库.

这行代码给我以下错误

export default combineReducers({
  user,songs,app
})

错误TS4082:模块的默认导出具有或正在使用私有的 名称为减速器".

关于发生的事情以及如何解决这个问题的任何想法?

解决方案

当我从redux库中显式导入 Reducer 时,错误消失了.

import { combineReducers, Reducer } from 'redux'

I've updated my ionic app from beta 11 to rc0. So it means I've switched from angular2 rc4 to angular2 stable and from typescript 1.8 to 2.

I have a redux architecture and am using the Redux library.

This line of code is giving me the following error

export default combineReducers({
  user,songs,app
})

error TS4082: Default export of the module has or is using private name 'Reducer'.

Any idea on what's going on and how to solve this?

解决方案

The error went away when I made an explicit import of Reducer from the redux library.

import { combineReducers, Reducer } from 'redux'

这篇关于键入错误“模块的默认导出具有或正在使用私有名称". -从打字稿v1.8切换到2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆