Skip to content

Could not resolve "ace-builds" #51

@goertzenator

Description

@goertzenator

I am trying to get a simple purescript-ace program built, but am met with the following build error:

[nix-shell:~/myapp]$ spago bundle-app       
[info] Build succeeded.
✘ [ERROR] Could not resolve "ace-builds"

    output/Ace/foreign.js:1:16:
      1 │ import ace from "ace-builds";
        ╵                 ~~~~~~~~~~~~

  You can mark the path "ace-builds" as external to exclude it from the bundle, which will remove
  this error.

1 error
[error] Bundle failed.

I am taking the "CDN" approach and have not run npm install ace-builds.

The error message suggest marking "ace-builds" as external, but I can find no options in spago for that. Any tips?

Some other context:

  • I have almost no background in js and js packaging.
  • I would like to eventually merge this Ace work into a much large nix build for an embedded device. That build doesn't have to deal with any npm stuff, and it would be simpler if it stayed that way.

My index.html is

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />

    <title>Ace Test</title>
    <!-- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.12/ace.min.js" charset="utf-8"></script> -->
    <script type="text/javascript" src="ace.js" charset="utf-8"></script>

    <link rel="stylesheet" href="css/pure-min.css" />
    <link rel="stylesheet" href="css/application.css" />
  </head>

  <body>
    <script src="index.js"></script>
  </body>
</html>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions