purescript/trypurescript

Uncaught ReferenceError: main is not defined

andys8 opened this issue · 3 comments

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

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

This was likely caused by #279 somehow.

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.