X Tutup
Skip to content

Purs compiled code is not valid when bundling with Parcel. #4589

@mitchellandwebb

Description

@mitchellandwebb

When I attempt to bundle my Purescript code from an index.js file using Parcel, and try to run it in Node, I get this error:

ReferenceError: module is not defined in ES module scope

The line referenced in the error points to this code:

// Generated by purs version 0.15.15
// Alias require to prevent webpack or browserify from actually requiring.
const $de56a81fd6a99b65$var$req = (0, module.require);

I don't understand how this aliasing works, or what it does. And I'm unsure whether it is blocking Parcel from figuring out the dependency tree. But for now it looks like I'll just have to avoid the use of Parcel, and use Webpack instead, if I want to bundle my Purescript code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup