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

Declaration or statement expected in 0.4.0-alpha.1 ver. #62

Open
essedger opened this issue Jun 23, 2020 · 11 comments
Open

Declaration or statement expected in 0.4.0-alpha.1 ver. #62

essedger opened this issue Jun 23, 2020 · 11 comments
Labels

Comments

@essedger
Copy link

Hello! Thank you for a perfect lib.
I saw that AsyncPaginatesupportsmenuIsOpen` in 0.4.0-alpha.1 version.

I am trying to use alpha version, but it is fail to compile.
image

@vtaits
Copy link
Owner

vtaits commented Jun 24, 2020

Hello. What version of typescript are you using?

@essedger
Copy link
Author

essedger commented Jun 24, 2020

Hello, typescript 3.5.3

@vtaits
Copy link
Owner

vtaits commented Jun 24, 2020

Can you show tsconfig?

@essedger
Copy link
Author

{
  "compilerOptions": {
    "baseUrl": "src",
    "target": "es5",
    "lib": [
      "dom",
      "dom.iterable",
      "esnext"
    ],
    "allowJs": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "strictPropertyInitialization": false,
    "typeRoots": [ "./typings", "./node_modules/@types" ],
    "jsx": "preserve"
  },
  "include": [
    "src"
  ]
}

@vtaits
Copy link
Owner

vtaits commented Jun 24, 2020

import type/export type is feature of typescript 3.8.

https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-exports

Can you upgrade?

@essedger
Copy link
Author

Thank you for your answer. I can't to upgrade TS version. Do you have another way to resolve this issue?

@vtaits
Copy link
Owner

vtaits commented Jun 26, 2020

I don't see a problem with upgrading ts, versions are non-conflict.

If this is not possible now, you can copy sources into your project and remove type from import type and export type statements.

@cadbox1
Copy link

cadbox1 commented Jul 8, 2020

I was running into this issue after setting up yarn workspaces.

my packages use typescript 3.83 but a dependency was using typescript 3.53 (same as yours funnily enough, are you using docz as well? 😉 )

For some reason this only caused issues on our CI bitbucket pipeline not locally.

I've solved it with yarn resolutions in the workspace root package.json. It has no effect when added to the package.json in a package in a workspace.

"resolutions": {
    "**/typescript": "3.8.3"
}

also had to clear my bitbucket pipeline cache.

hope that helps someone else 🙂

@TimAstier
Copy link

TimAstier commented Jul 22, 2020

In my project I'm also unable to upgrade TS for now, so I went with @vtaits's suggestion of copying the sources directly in the project. Thank you for creating this package, looking forward to use it directly as a dependency once I can update TS :)

[EDIT]: That didn't work in the end because the copy doesn't pass our tsc checks and there' s no way to exclude it from ts compiler... considering fixing ts errors on my local copy now :/

@d-alleyne
Copy link

d-alleyne commented Aug 3, 2020

I don't see a problem with upgrading ts, versions are non-conflict.

For small personal projects, upgrading is easy. For large projects, upgrading is challenging. I tried upgrading from TS v3.7 to TS v3.9 and it broke things. I downgraded to version 3.8.3, and I received warnings from a script in the build system that it was tested with earlier versions of Typescript.

@MohanadI
Copy link

Hi all any updates here ?

@vtaits vtaits added the legacy label Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants