react-timespan icon indicating copy to clipboard operation
react-timespan copied to clipboard

Can't resolve './Timeline.jsx'

Open qwwwpp opened this issue 5 years ago • 3 comments

I got the error after I plug in the 'react-timespan' Here is the error :

./node_modules/react-timespan/dist/index.js
Module not found: Can't resolve './Timeline.jsx' in '/Users/apple/Documents/Wish_Life/test/node_modules/react-timespan/dist'

the index.js require Timeline.jsx, but there is not such a file

qwwwpp avatar Mar 05 '19 17:03 qwwwpp

Ahhh, thanks for filing this report. It looks like the build process is transpiling .jsx into .js

I won't be able to get to this until later today (~12 hours), if you prefer to take a crack at it I'm happy to add you as a contributor :)

The easy fix I think for this issue is to not hardcode the .jsx extension but at the moment there is no development runtime for this repository. It was published as a keepsake.

You could also copy/paste the files from here into your codebase and remove the .jsx which might work better for your use case

coleturner avatar Mar 05 '19 17:03 coleturner

I copied the files and it works. But it doesn't work as what the demo looks like.

image

The timeline doesn't fit into a wide screen(there is a blank on the right side and the content is not centered), and the timeline is offset with the labels.

qwwwpp avatar Mar 05 '19 20:03 qwwwpp

The styles might be more nuanced than what is included here. That's my bad for not putting in a development runtime. You can find all the styles that may have been used for this component here:

https://github.com/coleturner/portfolio/tree/2091cfdb3a9904db08834ab0dd913f429bb44209/assets/stylesheets

coleturner avatar Mar 05 '19 20:03 coleturner