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 ReferenceError: exports is not defined in `embed.js` #318

Closed
jdormit opened this Issue Apr 4, 2017 · 6 comments

Comments

Projects
None yet
6 participants
@jdormit
Copy link

jdormit commented Apr 4, 2017

Both embed.dev.js and embed.min.js attempt to bind code to the exports object, which does not exist in a browser context. Is there a compile step which I missed?

Here's the stack trace for embed.min.js:

Uncaught ReferenceError: exports is not defined
    at comments.jeremydormitzer.com/js/embed.min.js:19
    at comments.jeremydormitzer.com/js/embed.min.js:19

And the same for embed.dev.js:

Uncaught ReferenceError: exports is not defined
    at embed.dev.js:1306
    at embed.dev.js:2205
@posativ

This comment has been minimized.

Copy link
Owner

posativ commented Apr 4, 2017

What version? From PyPi?

@jdormit

This comment has been minimized.

Copy link

jdormit commented Apr 4, 2017

This was using the Debian package.

I think I needed to use the isso server's hosted requirejs script. What I ended up doing was installing isso from source, and then using:

<script src="//comments.jeremydormitzer.com/js/config.js"></script>
<script data-main="//comments.jeremydormitzer.com/js/embed" src="//comments.jeremydormitzer.com/js/components/requirejs/require.js"></script>

I have a feeling I could have done something similar to make it work with the Debian package?

Anyway, it seems to be working now. Thanks for the quick response!

@jdormit jdormit closed this Apr 5, 2017

@bibiboot

This comment has been minimized.

Copy link

bibiboot commented Apr 21, 2017

@jdormit how were you able to solve this issue. I am currently also facing the same problem. I installed it using pip.

@imphil

This comment has been minimized.

Copy link

imphil commented Jun 4, 2017

I had the same issue with the debian package on Ubuntu 16.04. Using the embed.min.js file from https://posativ.org/isso/api/js/embed.min.js and putting that into my web directory solved the issue for now.

@andrew-vant

This comment has been minimized.

Copy link

andrew-vant commented Jul 29, 2017

I have the same issue, also with the ubuntu 16.04 package. It looks like this is a known bug with the debian/ubuntu package version 0.9.9, see here: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=783490. Newer versions are supposedly "fixed", but the changelog just says "use upstream javascript for now", and the file is missing from newer package versions. Why they were rolling their own JS I don't know.

I don't have a better workaround than manually installing the embed.min.js from master as commenters have mentioned above; but this was the first hit when I was trying to fix the problem myself, so I figured I'd save others the trouble of digging for the cause.

@jelmer

This comment has been minimized.

Copy link
Collaborator

jelmer commented Jul 29, 2017

We intentionally rebuild everything that is not the preferred form of modification (e.g. minified files), so that we know it is possible to make modifications and built the resulting artefacts.

FWIW the broken 0.9.9 package never actually ended up in a Debian release because of this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment