-
Notifications
You must be signed in to change notification settings - Fork 187
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
SwipeJS is not a module to import #110
Comments
You should just import swipejs, i.e.:
(as per this stackoverflow: https://stackoverflow.com/questions/40441252/typescript-typings-give-me-index-d-ts-is-not-a-module). |
The above, using Rollup (es6 imports) didn't work for me. |
In my TypeScript project built with create-react-app, this did not work:
It compiled OK but failed at runtime when my code called The import statement you really want is the one given by @powellian above:
...however, the TypeScript compiler chokes on this with the error:
I was able to fix this by changing this line in swipe.d.ts in my local node_modules folder:
to
As soon as I made this change, everything worked. So I'm with @paddy-wu, the swipe.d.ts file needs to be changed to fix this issue. I'll be happy to do a PR for this if you want. |
Hi, Upon checking master types/swipe.d.ts file is not updated with #130 PR I have gone deep and it seems that on 17th of March the #130 was merged, however on 30th of March @lyfeyaj reverted this changes on the commit dd78865 |
@JoseCMRocha: The change made by @lyfeyaj to types/swipe.d.ts on March 30th did not exactly revert my changes from PR #130. Instead, my change to use "export default" syntax was removed and "export = " syntax was added in its place; note that the file now ends in the line:
I'm not sure why @lyfeyaj made this change. But I'm fine with it ether way; it seems like both forms work fine in my application. I'm not seeing any versioning problems as you described. |
@RandScullard Here is why I've made this change: https://www.typescriptlang.org/docs/handbook/declaration-files/templates/module-class-d-ts.html |
@JoseCMRocha 2.2.13 was a typo, is fixed in version 2.2.18 |
@mkbctrl You may need to change your
For further information, please check below |
it seems to be forgot to export Swipe,so the es6 or ts module can not import,hope to update the swipe.d.ts file
The text was updated successfully, but these errors were encountered: