luckyframework / lucky

A full-featured Crystal web framework that catches bugs for you, runs incredibly fast, and helps you write code that lasts.
https://luckyframework.org
MIT License
2.57k stars 156 forks source link

Error compiling prod/release tasks in Crystal 1.6 #1750

Closed robcole closed 1 year ago

robcole commented 1 year ago
/ # crystal build --static --release --error-trace tasks.cr -o /usr/local/bin/lucky
In tasks.cr:12:1

 12 | require "./src/app"
      ^
Error: while requiring "./src/app"

In src/app.cr:4:21

 4 | Lucky::AssetHelpers.load_manifest "public/manifest.json"
                         ^------------
Error: expanding macro

In lib/lucky/src/lucky/asset_helpers.cr:12:8

 12 | {{ run "../run_macros/generate_asset_helpers", manifest_file }}
         ^--
Error: Error executing run (exit code: 1): ../run_macros/generate_asset_helpers public/manifest.json

stdout:

    unexpected token '<E at line 1, colu

stderr:

    Unhandled exception: unexpected token '<E at line 1, colu (JSON::ParseException)
      from ???
      from ???
      from ???
      from ???
      from ???
      from ???
      from src//homsrc/env/__libc_start_mai in 'libc_start_main_stage2'

Working on uploading a docker image for AMD/ARM architectures that should be able to trigger this fairly easily.

jwoertink commented 1 year ago

Are you using Vitejs? I see that your manifest file is named manifest.json instead of mix-manifest.json....

robcole commented 1 year ago

@jwoertink I'm using esbuild -- this is a project that works on 1.5.1 but fails on 1.6.0.

https://github.com/the-business-factory/hirobot.app/tree/preview/1.6.0 is a branch where compiling will fail. If you check that branch out, copy .env.example to .env, and run docker build . from the root you should eventually see the error. LMK what other info you need.

robcole commented 1 year ago

@jwoertink https://github.com/robcole/concierge is a clean repo that can reproduce this.

robcole commented 1 year ago

@jwoertink this might be better in 1.6.2 -- will LYK as one app works fine with Lucky + 1.6.2 right now.

robcole commented 1 year ago

@jwoertink 1.6.2 seems to fix this, I'm closing this issue.