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

Module has no exported member #778

Closed
wojexe opened this issue Feb 21, 2021 · 11 comments
Closed

Module has no exported member #778

wojexe opened this issue Feb 21, 2021 · 11 comments

Comments

@wojexe
Copy link

wojexe commented Feb 21, 2021

After importing import { useCssVariables } from "vue-composable" in the setup() function, accessing const { supported } = useCssVariables({}), program return this error: TS2305: Module '"../../../node_modules/vue-composable/dist/vue-composable"' has no exported member 'useCssVariables'.

I am using vue3 with TypeScript.

I have previously installed the package with npm install --save vue-composable and restarted the npm run serve afterwards.

vue-composable version: "^1.0.0-beta.18"

TS2305: Module '"../../../node_modules/vue-composable/dist/vue-composable"' has no exported member 'useCssVariables'.
    23 | <script lang="ts">
    24 | import { defineComponent, computed } from "vue";
  > 25 | import { useCssVariables } from "vue-composable";
       |          ^^^^^^^^^^^^^^^
@pikax
Copy link
Owner

pikax commented Feb 22, 2021

Thank you for reporting, do you mind providing a repo?

I've tried on my vite playground but couldn't reproduce it

@wojexe
Copy link
Author

wojexe commented Feb 24, 2021

Sorry for the delay. I've created a repo simillar to the one I had problems with, and the issue persisted. Here's a link to download the repo archived in a zip file: https://file.io/VBvt7aiMBjSo

@pikax
Copy link
Owner

pikax commented Feb 25, 2021

Sorry for the delay. I've created a repo simillar to the one I had problems with, and the issue persisted. Here's a link to download the repo archived in a zip file: https://file.io/VBvt7aiMBjSo

No worries, thank you, but it doesn't allow me to download it :D because the file has been deleted

@Herdismaria
Copy link

Herdismaria commented Feb 25, 2021

Same happens for usei18n.
Just updated from 1.0.0-beta.11 to 1.0.0-beta.18

I am using vue3 with TypeScript.

@pikax
Copy link
Owner

pikax commented Feb 25, 2021

Can you run node node_modules/vue-composable/scripts/postinstall.js on your project root folder? it might had an error installing the correct version

@wojexe
Copy link
Author

wojexe commented Feb 25, 2021

Sorry for the delay. I've created a repo simillar to the one I had problems with, and the issue persisted. Here's a link to download the repo archived in a zip file: https://file.io/VBvt7aiMBjSo

No worries, thank you, but it doesn't allow me to download it :D because the file has been deleted

Whoops. This link should work for 14 days from now on: http://transfer.sh/6GaVQ/vue-composable-repo.zip
Also, I forgot to notice, my working device runs is elementaryOS

@wojexe
Copy link
Author

wojexe commented Feb 25, 2021

Can you run node node_modules/vue-composable/scripts/postinstall.js on your project root folder? it might had an error installing the correct version

image
The problem persists for me after running postinstall.js manually

@pikax
Copy link
Owner

pikax commented Feb 25, 2021

That is caused by typescript version, the supported version is typescript@4 and it's using ~3.9

@wojexe
Copy link
Author

wojexe commented Feb 25, 2021

Oh. So it was this trivial 😁️.
As for me, this typescript version was installed by default by vue-cli and it did not get updated once I've installed vue-composable; you may consider adding a disclaimer about the minimum typescript version required to the project's readme, so people won't encounted this problem in the future.
I'm closing the issue as my problem got solved. Thanks for help and keep up the great work ☺️

@wojexe wojexe closed this as completed Feb 25, 2021
pikax added a commit that referenced this issue Feb 26, 2021
@pikax
Copy link
Owner

pikax commented Feb 26, 2021

Just added, glad to see it fixed, I usually keep my typescript on the latest on all my projects.

@Herdismaria do you still have the same problem after updating to typescript@4?

@Herdismaria
Copy link

No, that was the issue for me also. Thanks a lot for the help and for this awesome library 💯

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

3 participants