Skip to content

Spago does not emit an error when bundling an app's main module that does not have a main function #181

@JordanMartinez

Description

@JordanMartinez

Steps to reproduce:

mkdir explore-bundle-no-main
cd explore-bundle-no-main
spago init
# edit the `src/Main.purs` file to remove the "main" function
spago bundle -m Main -t dist/main.js

Spago doesn't fail with an error that Main.purs does not have a function called main. Thus, the output of the bundle is this:

// Generated by purs bundle 0.12.5
var PS = {};
PS["Main"].main();

One won't realize that the source of their issue is the compiled output until after exploring a few things more.

I only came across this because I used the wrong module name in the spago bundle command.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions