LIFFがCLIでlocalで開発できるらしい?
public.icon
#tech
LIFFがこれまではngrokを使わないとlocalのデバッグができなかったけど、それがいい感じにCLIコマンドを叩くだけでやってくれるらしい
MapMemoで試してみる
liff-cliが初めての人
アクセストークンをセットしろって言われる
file:///Users/kinjyoshotaro/dev/dev-private/map-memo/node_modules/.pnpm/@line+liff-cli@0.3.0/node_modules/@line/liff-cli/dist/serve/serveAction.js:22
throw new Error(`Access token not found.
^
Error: Access token not found.
Please set the current channel first.
at serveAction (file:///Users/kinjyoshotaro/dev/dev-private/map-memo/node_modules/.pnpm/@line+liff-cli@0.3.0/node_modules/@line/liff-cli/dist/serve/serveAction.js:22:15)
at async Command.<anonymous> (file:///Users/kinjyoshotaro/dev/dev-private/map-memo/node_modules/.pnpm/@line+liff-cli@0.3.0/node_modules/@line/liff-cli/dist/serve/commands/index.js:18:9)
Node.js v20.11.0
解決方法
3. liff channel add または liff channel use コマンドでチャネルを指定していない
参考資料: https://www.grandream.jp/blog/liff-cli-v0-2-0-noxin-ji-neng-liff-cli-servetoinspectorwojie-shuo
$ npx liff-cli channel add ChannlId
? Channel Secret?: ********************************
Channel 2005710452 is now added.
kinjyoshotaro@kinjoushoutarounoMacBook-Pro-2 map-memo %
$ npx liff-cli channel use ChannlId
Channel 2005710452 is now selected.
node-ptyをインストールしろって言われる
file:///Users/kinjyoshotaro/dev/dev-private/map-memo/node_modules/.pnpm/@line+liff-cli@0.3.0/node_modules/@line/liff-cli/dist/serve/proxy/ngrok-v1-proxy.js:14
throw new Error(Failed to import 'node-pty'. Please install it manually.);
^
Error: Failed to import 'node-pty'. Please install it manually.
$ pnpm add node-pty
ngrokのURLをoutputできなかったって言われる
file:///Users/kinjyoshotaro/dev/dev-private/map-memo/node_modules/.pnpm/@line+liff-cli@0.3.0_node-pty@1.0.0/node_modules/@line/liff-cli/dist/serve/proxy/ngrok-v1-proxy.js:46
reject(new Error("Not found ngrok URL from the output."));
^
Error: Not found ngrok URL from the output.
npxをしているから?
これはOSSのバグなので、修正PRを作った
https://github.com/line/liff-cli/pull/16