Node.js v20 で GitHubActions から Vercel へのデプロイがコケた話
Vercel が Node.js v20 無いとかエラー出してくる → Error: Found invalid Node.js Version: "20.x". Please set "engines": { "node": "18.x" } in your `package.json` file to use Node.js 18.
input
の maxlength
が空(null, undefined のとき)勝手に 0
になっていた[maxLength]
でのバインド[attr.maxlength]
を使う// app.component.ts import { Component } from "@angular/core"; @Component({ selector: "my-app", styleUrls: ["./app.component.scss"], templateUrl: "./app.component.html" }) export class AppComponent { public maxLength?: number; }
<!-- app.component.html --> OK: <input type="text" [attr.maxlength]="maxLength"><br><br> NG: <input type="text" [maxLength]="maxLength">
NGの方は maxLength="0"
でレンダリングされているため入力できない。
下記サンプルはv7だが、v11でも同様の現象を確認済み
max
やmin
の他の属性は大丈夫だったので地味な罠だった...🥺
Vercel が Node.js v20 無いとかエラー出してくる → Error: Found invalid Node.js Version: "20.x". Please set "engines": { "node": "18.x" } in your `package.json` file to use Node.js 18.
public ディレクトリにおいてる画像とかのパスを補完が効くようにしたい
windows はクソ(暴論)