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

Cannot find module '../../package.json' #4935

Closed
BANG88 opened this issue Feb 18, 2017 · 7 comments
Closed

Cannot find module '../../package.json' #4935

BANG88 opened this issue Feb 18, 2017 · 7 comments
Labels
🐛 Bug Ant Design Team had proved that this is a bug. TypeScript

Comments

@BANG88
Copy link
Member

BANG88 commented Feb 18, 2017

Error in E:\xxx\node_modules\antd\lib\version\index.d.ts
(1,25): error TS2307: Cannot find module '../../package.json'.

The latest version2.7.2 doesn't work with TypeScript project due to the version Component has import a package.json file.

cc @afc163 This need fixed or try another way export version info. TypeScript can't understand json file module at this time,may be it will support it in the future.

@BANG88 BANG88 added 🐛 Bug Ant Design Team had proved that this is a bug. TypeScript labels Feb 18, 2017
@afc163
Copy link
Member

afc163 commented Feb 18, 2017

I forgot index.d.ts. 😓

@afc163 afc163 closed this as completed in 8283a36 Feb 18, 2017
@xuyang2
Copy link

xuyang2 commented Feb 22, 2017

Workaround for TypeScript 2+
in your typings.d.ts

declare module "*.json" {
    export let version;
}

@Penggggg
Copy link

您好!~我是小白..什么意思呀?是要改 ‘ scripts/prepub.js’ 文件吗?我找不到这个文件呀

afc163 added a commit that referenced this issue Feb 24, 2017
@afc163
Copy link
Member

afc163 commented Feb 24, 2017

@Penggggg Wait for patch version later in today.

@Penggggg
Copy link

@afc163 Thanks for your response. But i still can't resolve this problem.. would you tell me in detail? thank you ! 感谢您的回复,请问patch是已经发版了吗?

@afc163
Copy link
Member

afc163 commented Feb 27, 2017

2.7.3

@lock
Copy link

lock bot commented May 2, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 Bug Ant Design Team had proved that this is a bug. TypeScript
Projects
None yet
Development

No branches or pull requests

4 participants