lamby-cookiecutter icon indicating copy to clipboard operation
lamby-cookiecutter copied to clipboard

ActionView::Template::Error - application.css not present in asset pipeline

Open rjschof opened this issue 1 year ago • 2 comments

Running on macOS Sonoma 14.1.1 within the VS Code Dev Container. Deployed to AWS Lambda without any code changes.

Following error appears in CloudWatch when visiting the application URL:

Skipped bootstraping TelemetryLog
Executing 'config/environment.Lamby.cmd' in function directory '/app'
EXTENSION	Name: crypteia	State: Ready	Events: [INVOKE, SHUTDOWN]
START RequestId: 23179998-e9a5-47f1-a419-3a610288b33b Version: 1
{
    "method": "GET",
    "path": "/",
    "format": "html",
    "controller": "ApplicationController",
    "action": "index",
    "status": 500,
    "allocations": 1806,
    "duration": 12,
    "view": 0,
    "db": 0,
    "requestid": "23179998-e9a5-47f1-a419-3a610288b33b"
}

ActionView::Template::Error (The asset "application.css" is not present in the asset pipeline.
):
5:     <title>RailsLambdaApp</title>
6:     <%= csrf_meta_tags %>
7:     <%= csp_meta_tag %>
8:     <%= stylesheet_link_tag "application" %>
9:     <%= javascript_importmap_tags %>
10:   </head>
11:   <body>
app/views/layouts/application.html.erb:8
END RequestId: 23179998-e9a5-47f1-a419-3a610288b33b
REPORT RequestId: 23179998-e9a5-47f1-a419-3a610288b33b	Duration: 36.03 ms	Billed Duration: 9667 ms	Memory Size: 1792 MB	Max Memory Used: 151 MB	Init Duration: 9630.86 ms	
START RequestId: bc61eae5-df4a-4cd8-b433-c486c681f35c Version: 1
END RequestId: bc61eae5-df4a-4cd8-b433-c486c681f35c

rjschof avatar Nov 28 '23 19:11 rjschof

There is .dockerignore file generated in the top folder with /public/assets path. Commenting it out solves the problem.

arekt avatar Feb 16 '24 02:02 arekt

Thank you @arekt 🎉 . We should remove that line from the template I guess.

andreimerfu avatar Feb 19 '24 14:02 andreimerfu