Skip to content
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

Uncaught SyntaxError: Cannot use import statement outside a module #16

Closed
youresoshain opened this issue Apr 23, 2020 · 2 comments
Closed

Comments

@youresoshain
Copy link

Im getting the error

Uncaught SyntaxError: Cannot use import statement outside a module

import DEFAULTS from './defaults';
import TEMPLATE from './template';
import render from './render';
import preview from './preview';
import events from './events';
import handlers from './handlers';
import change from './change';
import methods from './methods'

@youresoshain
Copy link
Author

i was able to get around this error by adding type="module" to the cropper.js script source and appending .js to the file names in the import methods but now it says:

Uncaught TypeError: $(...).cropper is not a function
at imagecropper (eval at (jquery.js:1), :88:24)
at Object.success (eval at (jquery.js:1), :73:8)
at c (jquery.js:1)
at Object.fireWith [as resolveWith] (jquery.js:1)
at k (jquery.js:1)
at XMLHttpRequest.r (jquery.js:1)
imagecropper @ VM12676:88
success @ VM12676:73
c @ jquery.js:1
fireWith @ jquery.js:1
k @ jquery.js:1
r @ jquery.js:1
XMLHttpRequest.send (async)
send @ jquery.js:1
ajax @ jquery.js:1
uploadData @ VM12676:60
eval @ VM12676:53
dispatch @ jquery.js:1
v.handle @ jquery.js:1

@youresoshain
Copy link
Author

It seems all of the above was wrong and i shouldve been using the dist versions. Sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant