question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Typescript definition is error TS2714

See original GitHub issue

I have problem with typescript definition in your lib/index.d.ts

image I also tried to import with this way But it throws the same error.

import { Result } from 'ant-design-pro';

The error is

/home/romsy/Code/Projects/lumpang/office/node_modules/ant-design-pro/lib/index.d.ts
(21,16): error TS2714: The expression of an export assignment must be an identifier or qualified name in an ambient context.

I think the error is coming from your type definition. Here’s I inspect into your type def.

pro ant error

Here’s my tsconfig.json config

{
  "compilerOptions": {
    "outDir": "build/dist",
    "module": "esnext",
    "target": "es5",
    "lib": ["es6", "dom"],
    "sourceMap": true,
    "allowJs": true,
    "jsx": "react",
    "moduleResolution": "node",
    "rootDir": "src",
    "forceConsistentCasingInFileNames": true,
    "noImplicitReturns": false,
    "noImplicitThis": false,
    "noImplicitAny": false,
    "strictNullChecks": false,
    "suppressImplicitAnyIndexErrors": true,
    "noUnusedLocals": true,
    "experimentalDecorators": true,
    "allowSyntheticDefaultImports": true,
    "typeRoots": ["./node_modules/@types", "./typings"],
    "baseUrl": "src",
    "paths": {
      "~/*": ["*"]
    }
  },
  "include": ["./src/**/*", "./typings"],
  "exclude": [
    "node_modules",
    "build",
    "scripts",
    "acceptance-tests",
    "webpack",
    "jest",
    "src/setupTests.ts"
  ]
}

Any solution will be apreciated. Thanks

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
chenshuai2144commented, Oct 13, 2018

i will fixed in new version

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error TS2714 with TypeScript definition file · Issue #27 - GitHub
This error does not occur in using version 1.1.0. We're using TypeScript 2.8.3. C:/Work/Journeys/radar/client/node_modules/http-status/lib/index ...
Read more >
Typescript (at-loader) compiler errors in WebPack
ERROR in [at-loader] ./node_modules/uri-js/src/punycode.d.ts:9:17 TS2714: The expression of an export assignment must be an identifier or ...
Read more >
ts-custom-error - npm
ts-custom-error is a tiny (~500 bytes of minified & gzipped Javascript) package providing a CustomError class and a customErrorFactory function ...
Read more >
Documentation - TypeScript 2.6
The first assignment is now an error. Effectively, T is contravariant in Comparer<T> because it is used only in function type parameter positions....
Read more >
TypeScript errors and how to fix them
A list of common TypeScript errors and how to fix them.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found