Skip to content

2.0.3 typescript error #459

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

Closed
doits opened this issue Jan 21, 2020 · 10 comments
Closed

2.0.3 typescript error #459

doits opened this issue Jan 21, 2020 · 10 comments

Comments

@doits
Copy link

doits commented Jan 21, 2020

I updated to 2.0.3 but it now gives a typescript error:

ERROR in .../node_modules/v-tooltip/types/index.d.ts(3,1):
3:1 Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier.
    1 | import Vue, { VueConstructor, DirectiveOptions, PluginFunction } from 'vue';
    2 |
  > 3 | const vToolTip: PluginFunction<any>;
      | ^
    4 | export default vToolTip;
    5 |
    6 | export const VPopover: VueConstructor<Vue>;

I think it is resolved by changing lines 3 and 4 to one line:

export default const vToolTip: PluginFunction<any>;

At least with this I have no typescript error anymore, but I am not sure if this changes the meaning.

@mad4hit
Copy link

mad4hit commented Jan 23, 2020

same problem here. but i suggest to use:

`
declare const vToolTip: PluginFunction;

export default vToolTip;
`

Because export default const is not allowed

@cristianireyes
Copy link

As a partial solution you can add "skipLibCheck": true in your tsconfig.json

cristianireyes added a commit to cristianireyes/v-tooltip that referenced this issue Jan 25, 2020
@cristianireyes
Copy link

As a partial solution you can add "skipLibCheck": true in your tsconfig.json

I sent pull request with solution to fix #459

@connorshea
Copy link

FYI: To avoid getting these issues when upgrading packages, you can run npm run tsc or yarn run tsc in your CI to verify TypeScript is able to compile your code. I'm not sure if tsc would work for v-tooltip itself since I don't think the entire project is written in TypeScript?

I didn't have this in my CI until now, so this issue bit me, but I'm glad I have another safeguard in my CI :D

@solidevolution
Copy link

What about this issue? @Akryum ?

gwennlbh added a commit to schoolsyst/webapp that referenced this issue May 22, 2020
@will-hang
Copy link

@Akryum pls help @Akryum

@solidevolution
Copy link

A good solution instead of using this library was to implement an own vue component with plain, configurable TippyJS. With that, also PropperJS Bugs are gone.

@jwkicklighter
Copy link

@solidevolution Not sure how the PopperJS bugs can be gone with TippyJS since it uses popper under-the-hood...

Regardless, that doesn't really help with this issue at all.

@okandas
Copy link

okandas commented Sep 22, 2020

@imwillhang, @solidevolution and @Akryum pull request that fixes this .. We should be good to go

@elwin013
Copy link

Locally working fix based on: stephenmathieson/node-tlds#11

  1. create file src/vtooltip.d.ts with content:
import Vue, {VueConstructor, DirectiveOptions, PluginFunction} from 'vue';

declare const vToolTip: PluginFunction<any>;
export default vToolTip;

export const VPopover: VueConstructor<Vue>;
export const VClosePopover: DirectiveOptions;
export const VTooltip: DirectiveOptions;
  1. Add path in tsconfig.json in compileOptions section:
"paths": {
...
      "v-tooltip": [
        "src/vtooltip.d.ts"
      ],
...
    },

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

9 participants