Closed Ymil closed 7 months ago
Good morning!
Thankyou for bringing this to our attention. I have never used Vite so I don't know how helpful I can be. Please try installing react-moment manually in your package.json file. Please also try deleting your node_modules folder and reinstalling them.
If you find a solution please let us know.
Hi, I am experiencing the same issue @anthony0030 even after performing the above suggested steps.
@Ymil have you found a solution?
Hi @Axolem, are you also using Vite? Could you let me know if you are using the latest version f the packages? Please provide a minimal code pen example that causes this error.
Hello, I did not solve the problem, sorry.
Maybe it's typescript that's the problem? @Axolem you are using typescript too?
Hi @Ymil and @Axolem, Please provide a simple code example that causes this bug and I will be happy to help.
Closing due to inactivity.
I'm currently facing this issue as well, I'll post the code I'm trying to run with the Clock component.
Time.tsx:
import Clock from 'react-live-clock'
export default function Time() {
return <Clock format={'HH:mm:ss'} ticking={true} />
}
App.tsx:
import './App.css'
import Quote from './components/quote/Quote'
import Time from './components/time/Time'
function App() {
return (
<div>
<Quote />
<Time />
</div>
)
}
export default App
Do you only have this problem with typescript?
I'm using Typescript for this project yeah, but I haven't tried it with Javascript. Using Vite + TS + React.
I am not good with TS. I started maintaining this package but others have helped me with the TS. If you could please review the source code for any bugs in TS. I wish I had knowledge of vite to help debug. There might need to be some adjustments for the package to be vite compatible.
My best guess is it has to be something with how Vite bundles and minifies it. Don't think it's Typescript related.
I found this for you. https://github.com/vitejs/vite/issues/7376
This package relies on react moment. Possibly one of the workarounds in the above thread will work. Please keep me posted.
To be honest I just ended up using this instead. If anyone wants to try the solution above can go ahead.
Hi @gmadharh, Thanks for the update!
I will be re-closing this issue since it seems to be a problem with Moment and Vite combo.
Thank you for considering react-live-clock in your project.
Hi, i have a problem when tried use the react-live-clock.
The problem is when I try to use the react-live-clock library, when I run, on the server I have no errors but it doesn't show the site in the browser and in the console I see the following message.
The error doesn't tell me anything, and I can't debug the javascript file without compiling it for vite, the problem I think is in react-moment.
This is my json package
Code implemented:
I did not find clues or possible solutions and I wanted to see if it was a problem that they already knew about.