nicklassvendsrud / react-swipe-to-reveal-actions

A React component for (list) items with swipe to reveal actions.
MIT License
16 stars 6 forks source link

Module parse failed: Unexpected token type Props #6

Closed rmeissen closed 1 year ago

rmeissen commented 2 years ago

I installed as per the documentation, and immediately upon use this is the error I see:

./node_modules/react-swipe-to-reveal-actions/SwipeToRevealActions.tsx 5:5
Module parse failed: Unexpected token (5:5)
You may need an appropriate loader to handle this file type.
| import './styles.css';
| 
> type Props = {
|     children: React.ReactNode;
|     actionButtons: {

Any suggestions or help appreciated!

bvalasek commented 1 year ago

same, tried it in fresh create-react-app and same result and install as per documentation. I had some issue with this line "types": ["vite/client", "jest", "testing-library__jest-dom"], underCompiler options. When commented out webpack was still unable to compile :

Module not found: Error: Can't resolve './SwipeToRevealActions' in '/Users/.../swipable_mobile_actions/node_modules/react-swipe-to-reveal-actions'
ERROR in ./node_modules/react-swipe-to-reveal-actions/index.ts 1:0-49
Module not found: Error: Can't resolve './SwipeToRevealActions' in '/Users/.../swipable_mobile_actions/node_modules/react-swipe-to-reveal-actions'

webpack compiled with 1 error
nicklassvendsrud commented 1 year ago

Hi! Sorry about this @rmeissen , @bvalasek . Please upgrade to version 1.0.7, and this should be fixed. Thanks!