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

import { type 'xxx' } from './xxx' TS:1005: ',' expected #2584

Open
zhangjuncheng1 opened this issue Aug 6, 2024 · 8 comments
Open

import { type 'xxx' } from './xxx' TS:1005: ',' expected #2584

zhangjuncheng1 opened this issue Aug 6, 2024 · 8 comments
Assignees

Comments

@zhangjuncheng1
Copy link

问题描述

@antv/l7: 2.17.3 版本,安装的依赖是commonjs 的包,<= 2.17.3 应该是esnext 的包, ts 会报错;使用 <= 2.17.3 的包 会出现这个问题 #1782

重现链接

No response

重现步骤

No response

预期行为

No response

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

@lvisei
Copy link
Member

lvisei commented Aug 6, 2024

升级最新版本 2.22.0 或 2.21 吧 @zhangjuncheng1

@zhangjuncheng1
Copy link
Author

我试试

@zhangjuncheng1
Copy link
Author

项目中的typescript 为4.2.2,不支持 export { type xxx } from './xxx' 的语法 。。。

export { LayerPopup, type ILayerPopupOption, type LayerField, type LayerPopupConfigItem, } from './popup/layerPopup';
~~~~~~~~~~~~~~~~~~~~

node_modules/@antv/l7-layers/es/canvas/models/canvas.d.ts:2:15 - error TS1005: ',' expected.

@lvisei
Copy link
Member

lvisei commented Aug 6, 2024

升级 typescript 5.0 以上

@zhangjuncheng1
Copy link
Author

项目中很多是基于typescript4的依赖,要是能基于typescript4发一个版本就好了

@lvisei
Copy link
Member

lvisei commented Aug 12, 2024

项目中很多是基于typescript4的依赖,要是能基于typescript4发一个版本就好了

4 支持这样写吗 import type { 'xxx' } from './xxx',可以的话可以来帮忙改下

@zhangjuncheng1
Copy link
Author

我看从3.8 开始支持的,应该可以

@lvisei
Copy link
Member

lvisei commented Aug 23, 2024

我看从3.8 开始支持的,应该可以

可以来贡献一下,提交一个 PR

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

2 participants