前提・実現したいこと
「) expected」「at-rule or selector expected」のエラーが発生しました。画像自体は表示できていますが解決したいです
発生している問題・エラーメッセージ
) expected [{ "resource": "/Users/tokugawa/Desktop/genders/resources/views/index.blade.php", "owner": "_generated_diagnostic_collection_name_#1", "code": "css-rparentexpected", "severity": 8, "message": ") expected", "source": "css", "startLineNumber": 31, "startColumn": 70, "endLineNumber": 31, "endColumn": 71 }] at-rule or selector expected [{ "resource": "/Users/tokugawa/Desktop/genders/resources/views/index.blade.php", "owner": "_generated_diagnostic_collection_name_#1", "code": "css-ruleorselectorexpected", "severity": 8, "message": "at-rule or selector expected", "source": "css", "startLineNumber": 31, "startColumn": 91, "endLineNumber": 31, "endColumn": 92 }]
該当のソースコード
index.php
1 <div class="news_cards"> 2 @foreach ($articles as $article) 3 <div class="news_card"> 4 <a href="{{ route('article.show', $article) }}"> 5 <div class="thumbnail" style="background-image: url({{ $article->thumbnail }})" ⇦ここが原因のようです> 6 </div> 7 <div class="card_info"> 8 <div class="title _ellipsised">{{ $article->title }}</div> 9 <div class="meta"> 10 <span class="publisher">{{ $article->site_name }}</span> 11 <span class="published">{{ $article->published ? $article->published : $article->created_at->diffForHumans() }}</span> 12 </div> 13 <div class="description _ellipsised">{{ $article->description }}</div> 14 <div class="sum_comment"> 15 <span class="value">{{ $article->comments->count() }}</span> 16 <span class="unit">こめんと</span> 17 </div> 18 </div> 19 </a> 20 </div> 21 @endforeach 22 </div>
UserController.php
1<?php 2 3namespace App\Http\Controllers; 4 5use Illuminate\Http\Request; 6use App\Models\User; 7use App\Models\Comment; 8use App\Models\Article; 9use Illuminate\Support\Facades\Auth; 10use Illuminate\Support\Facades\Storage; 11use Illuminate\Support\Facades\DB; 12use Exception; 13 14class UserController extends Controller 15{ 16 public function index() 17 { 18 $user = Auth::user(); 19 $comments = Comment::leftjoin('followings', 'comments.user_id', '=', 'followings.following_user_id')->where('followings.user_id', $user->id)->orwhere('comments.user_id', $user->id)->select('comments.*')->latest('comments.updated_at')->get(); 20 $articles = Article::latest()->get(); 21 $followCount = $user->follows()->count(); 22 23 return view('index', [ 24 'user' => $user, 25 'articles' => $articles, 26 'comments' => $comments, 27 'followCount' => $followCount, 28 ]); 29 }
試したこと
該当のエラーワードで検索しましたが解決できませんでした
補足情報(FW/ツールのバージョンなど)
VSCode 1.64.0
Laravel 8.79.0
PHP 8.1.1
Docker 20.10.12

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/02/08 01:56