lumeland / base-blog

A template repository to build a blog with Lume static site generator
https://lumeland.github.io/base-blog/
97 stars 13 forks source link

Out of the box experience leads to "Error: No target found" #5

Open irbull opened 2 years ago

irbull commented 2 years ago

If you follow the steps in the README:

The system errors out with:

Error: No target found
    at downloadBin (https://deno.land/x/dbin@v0.1.1/mod.ts:71:11)
    at async downloadBinary (https://raw.githubusercontent.com/lumeland/experimental-plugins/main/pagefind/deps.ts:4:10)
    at async (https://raw.githubusercontent.com/lumeland/experimental-plugins/main/pagefind/mod.ts:115:22)
    at async Events.dispatchEvent (https://deno.land/x/lume@v1.11.3/core/events.ts:49:11)
    at async Site.build (https://deno.land/x/lume@v1.11.3/core/site.ts:486:5)
    at async build (https://deno.land/x/lume@v1.11.3/cli/build.ts:36:3)
    at async Command.execute (https://deno.land/x/cliffy@v0.25.1/command/command.ts:1433:7)
    at async (https://deno.land/x/lume@v1.11.3/cli.ts:182:3)

The docs suggest configuring _config.js, but I'm not sure what to adjust. This error appears related to pageFind, because if I remove that configuration then the serve works.

oscarotero commented 2 years ago

It looks like pagefind cannot find a binary file for your computer. The pagefind plugin download one of the files of the release assets: https://github.com/CloudCannon/pagefind/releases/tag/v0.8.1 These are the possible targets: https://github.com/lumeland/experimental-plugins/blob/main/pagefind/deps.ts#L9-L11

Please, run deno in your terminal and then typeDeno.build. What it returns?

irbull commented 2 years ago
Deno 1.25.3
exit using ctrl+d or close()
> Deno.build
{
  target: "aarch64-apple-darwin",
  arch: "aarch64",
  os: "darwin",
  vendor: "apple",
  env: undefined
}
irbull commented 2 years ago

Ah, looks like it's related to the Mac M1 (arm) architecture.

oscarotero commented 2 years ago

Ok, understood. Does the x86_64 architecture work on Mac M1? You can download the binary https://github.com/CloudCannon/pagefind/releases/tag/v0.8.1 and save it into _bin/pagefind. And then run lume blog.

If it works fine, I'll change the plugin to download the same binary for all macOS.

oscarotero commented 2 years ago

It looks like the npm package returns the same binary for all darwin architectures: https://github.com/CloudCannon/pagefind/blob/84d5941afeaf4e3bfc85cb369a762f01b931c5c0/wrappers/node/lib/postinstall.js#L39 I'll fix that.