You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用export * as别名导出模块报错,需额外loader?求排查

模块别名导出报错排查求助

我在使用export * as Styled from './styled';这种别名导出模块时出现报错,但查阅MDN文档确认该导出语法是合法的。以下是相关代码及报错信息,恳请帮忙排查问题:

相关代码

index.ts

export * from './dummyData';
export * from './interface';
export * as Styled from './styled'; // 此行疑似引发报错

styled.ts

export const Header = styled.div`
  display: flex;
  position: relative;
  align-items: center;
  height: 60px;
  padding: 0 20px;
  border-bottom: 1px solid ${colors.grey450};
`;

export const IconWrapper = styled.div`
  position: absolute;
  top: 18px;
  right: 16px;
  cursor: pointer;
`;
// 其他导出内容省略

报错信息

You may need an additional loader to handle the result of these loaders.
| export * from './dummyData';
| export * from './interface';
> export * as Styled from './styled';

内容的提问来源于stack exchange,提问作者Wreeecks

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.05 14:00:52