-
Notifications
You must be signed in to change notification settings - Fork 778
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
Can't import as ES module: SyntaxError: ambiguous indirect export: tns
#822
Comments
tomyo
changed the title
Can't import as ES module
Can't import as ES module: Jun 19, 2023
SyntaxError: ambiguous indirect export: tns
I modified the first line of the minified script from the cnd, from: var tns = (function () {...})() to export const tns = (function () {...})() And now the import seems to work from a module. I'll leave the issue open since I consider this as something to be fixed / improved. ES imports are the modern way to include stuff from other scripts. Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue description:
Following the docs, if I include the js file from the cdn (I downloaded that file from https://cdnjs.cloudflare.com/ajax/libs/tiny-slider/2.9.4/min/tiny-slider.js), and then try to import it in a module as:
I get this error in browser:
SyntaxError: ambiguous indirect export: tns
I see in the source that there's no export, just a global variable
tns
defined.Am I importing it wrong or using the wrong file?
Thanks.
P.S.: I don't use a bundler, so npm install is not an option for me.
P.S.2: cdn link for js file in readme is for version 2.9.2.
Tiny-slider version: 2.9.4
Browser name && version: firefox 114
OS name && version: linux
The text was updated successfully, but these errors were encountered: