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

[BUG] Cannot find module 'telefunc/react-streaming' or its corresponding type declarations. #76

Closed
VienDinhCom opened this issue Jun 30, 2023 · 8 comments
Labels
bug 💥 Something isn't working

Comments

@VienDinhCom
Copy link

Hi @brillout,

I find this bug when try to import telefunc/react-streaming.

import { useData } from 'telefunc/react-streaming';

Error: Cannot find module 'telefunc/react-streaming' or its corresponding type declarations.

By the way, vite, vite-plugin-ssr, telefunc and react-streaming are awesome. I really like them ❤

@brillout
Copy link
Owner

The example at /examples/react-streaming/ is working and uses that import, so I'm not sure why it doesn't work for you.

I'll need a reproduction.

By the way, vite, vite-plugin-ssr, telefunc and react-streaming are awesome. I really like them ❤

I'm glad you like them. In case you're able to convince your employer: https://github.com/sponsors/brillout — it makes a big difference!

@VienDinhCom
Copy link
Author

VienDinhCom commented Jul 1, 2023

Hi @brillout,

I noticed that the react-streaming is missing in the node_modules/telefunc directory, which could be the cause of the issue.

Here is a screenshot showing the missing package:

image

I am currently using your libraries to build my stack, and if they work perfectly, I would be happy to promote them within the JavaScript community in Vietnam.

Thank you!

@brillout
Copy link
Owner

brillout commented Jul 1, 2023

I noticed that the react-streaming is missing in the node_modules/telefunc directory, which could be the cause of the issue.

It's a peer dependency: make sure to install it.

I am currently using your libraries to build my stack, and if they work perfectly, I would be happy to promote them within the JavaScript community in Vietnam.

💯

@VienDinhCom
Copy link
Author

VienDinhCom commented Jul 1, 2023

I can assure you that I have the react-streaming package installed.

Currently, I have to import the useData hook lie this:

import { useData } from 'telefunc/dist/esm/shared/react-streaming/useData';

Updated: Importing like this doesn't work.

@brillout
Copy link
Owner

brillout commented Jul 1, 2023

I'll need a reproduction.

@VienDinhCom
Copy link
Author

VienDinhCom commented Jul 1, 2023

Environment

I used volta to install node and npm.

Node: 18.16.1
NPM: 9.5.1
OS: Ubuntu 22.04

Example

https://github.com/brillout/telefunc/tree/main/examples/react-streaming

Dependencies

I must install dependencies with the command below, because there is a problem: Fix the upstream dependency conflict, or retry this command with --force or --legacy-peer-deps to accept an incorrect (and potentially broken) dependency resolution.

npm i --force

Status

The bug is also in your example:

image

@brillout brillout added the bug 💥 Something isn't working label Jul 1, 2023
@brillout
Copy link
Owner

brillout commented Jul 1, 2023

Fix released in 0.1.58.

@VienDinhCom
Copy link
Author

VienDinhCom commented Jul 1, 2023

It works! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 💥 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants