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 ReferenceError: main is not defined #284

Closed
andys8 opened this issue Jul 12, 2022 · 3 comments · Fixed by #288
Closed

Uncaught ReferenceError: main is not defined #284

andys8 opened this issue Jul 12, 2022 · 3 comments · Fixed by #288

Comments

@andys8
Copy link
Contributor

andys8 commented Jul 12, 2022

The seems to be a small issue that a call to main is not working. It can be reproduced, but it doesn't seem to affect functionality.

How to reproduce the issue

Uncaught ReferenceError: main is not defined

image

image

@JordanMartinez
Copy link
Contributor

JordanMartinez commented Jul 12, 2022

I can't reproduce this. Nevermind, I can.

@JordanMartinez
Copy link
Contributor

This was likely caused by #279 somehow.

@JordanMartinez
Copy link
Contributor

So, I thought main here referred to the frame.js's main that I add to call the compiled module's JS code. However, the main referenced here is the client's code.

The issue is caused by this line in package.json

I was using spago bundle-app, which I forgot adds the final main(); call before bundling it. So, in the bundle script, my extra addition of a main(); call via the --footer:js=\"\n\nmain();\" arg passed to esbuild is what causes this reference error.

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

Successfully merging a pull request may close this issue.

2 participants