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

not working in pure js code #104

Open
mokhtasatxyz opened this issue Jan 1, 2021 · 1 comment
Open

not working in pure js code #104

mokhtasatxyz opened this issue Jan 1, 2021 · 1 comment

Comments

@mokhtasatxyz
Copy link

hello

i use this script but not worked for me

i work in pc local and i don't use any server and i use chrome browser

i have error : Uncaught SyntaxError: Cannot use import statement outside a module

`<script src="jquery-3.2.1.min.js"> </script>

<script src="https://unpkg.com/merge-images"></script>

<script> import mergeImages from 'merge-images'; mergeImages(['/body.png', '/eyes.png', '/mouth.png']) .then(b64 => document.querySelector('img').src = b64); // data:image/png;base64,iVBORw0KGgoAA... </script> `
@ideathingdev
Copy link

ideathingdev commented Feb 11, 2021

I thought it was me not doing things properly, I was about to go crazy!
I have other errors:

index.js:22 Uncaught (in promise) TypeError: Cannot read property 'constructor' of undefined

    at index.js:22
    at new Promise (<anonymous>)
    at index.js:20
    at Array.map (<anonymous>)
    at index.js:20
    at new Promise (<anonymous>)
    at mergeImages (index.js:12)

If I don't use the import module part, please if someone has any insight on this it would be huge help

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

2 participants