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

Under Firefox 65.0: SyntaxError: dynamic module import is not implemented commands.js:3:44 #1

Closed
bgoodr opened this issue Feb 23, 2019 · 2 comments

Comments

@bgoodr
Copy link

bgoodr commented Feb 23, 2019

Hi,

I'm the original poster of the SE question: https://webapps.stackexchange.com/questions/82693/how-can-i-view-google-photos-that-are-not-in-a-google-photos-album and saw your answer at https://webapps.stackexchange.com/a/125617/14529

Encouraged, I wanted to give it a spin. So, I forked your gapi-querier repo, made no changes to it in my fork, and followed the directions to the letter. I am now able to see the website at https://bgoodr.github.io/gapi-querier/.

Copying/pasting my Client ID into that field and hitting enter did not show anything. So I opened up Web Developer/Console (I'm using Firefox version 65.0) and saw:

SyntaxError: dynamic module import is not implemented commands.js:3:44

I cleared the web console output, and reloaded the page, and the above error reproduced. So, it is not due to OAUTH authorization yet, but due to javascript syntax.

I retried it under Google Chrome (Version 72.0.3626.109 (Official Build) (64-bit)), and it worked (I did have to force it to authorize as for some reason my app was not authorized). So something is not being adequately supported in Firefox 65 I think, or maybe Google Chrome is a bit lax?

Looking at the code I do see an import statement at https://github.com/jonagh/gapi-querier/blob/master/commands.js#L3

So I searched for that error on the web, I found https://stackoverflow.com/a/46415925/257924 which leads me further to to believe that the syntax there might still be not treated identically between Firefox and Chrome. I did notice that you do have a directive to declare “main.js” as a module at https://github.com/jonagh/gapi-querier/blob/master/index.html#L47 , but maybe Firefox insists that you also declare “commands.js” as a module too?

I really would love to see this working under Firefox. I don’t use Chrome, and it would be painful for me to switch to it.

Thanks,
bgoodr

@jonagh
Copy link
Owner

jonagh commented Feb 23, 2019

Yup you're right.. Firefox doesn't support dynamic imports yet (it is currently behind a flag).
I didn't really consider cross-browser support - I should have, I guess, but I was just hacking it together for my own purposes.

I have now changed the dynamic imports (in commands.js) to static imports (16ee5bf).
I tested in the latest version of Firefox and it seems to work now :)

Let me know if it works out.

@jonagh jonagh closed this as completed Feb 23, 2019
bgoodr added a commit to bgoodr/gapi-querier that referenced this issue Feb 24, 2019
…merge_upstream_16ee5bf5396536a78cf9ed15b554fd8b439b6fe9

Pulling in fix at
jonagh#1 (comment)
into my fork, for further testing.
@bgoodr
Copy link
Author

bgoodr commented Feb 24, 2019

Thanks for the fix. I've pulled in and verified that now I'm able to start the run. However, I do not see any output, but that is a separate issue which I will file (probably user error on my part).

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