line / create-liff-app

Start developing LIFF application with a simple CLI command.
https://developers.line.biz/en/docs/liff/
Apache License 2.0
63 stars 7 forks source link

Conflict occurs when I use app router in next.js #28

Closed Papillon6814 closed 5 months ago

Papillon6814 commented 1 year ago

Hello. I found a small bug there.

First, I tried @create-liff-app command in this way.

> npx @line/create-liff-app sample                                                                                                                                                                                           
Welcome to the Create LIFF App
? Which template do you want to use? nextjs
? JavaScript or TypeScript? TypeScript
? Please enter your LIFF ID:
 Don't you have LIFF ID? Check out https://developers.line.biz/ja/docs/liff/getting-started/ liffId
? Which package manager do you want to use? npm

Generating liff app using `create-app`, this might take a while.

✔ Would you like to use ESLint? … No / Yes
✔ Would you like to use Tailwind CSS? … No / Yes
✔ Would you like to use `src/` directory? … No / Yes
✔ Would you like to use App Router? (recommended) … No / Yes
✔ Would you like to customize the default import alias? … No / Yes

Using npm.

Initializing project with template: app-tw

Installing dependencies:
- react
- react-dom
- next
- typescript
- @types/react
- @types/node
- @types/react-dom
- tailwindcss
- postcss
- autoprefixer
- eslint
- eslint-config-next

Then my tmux creates a project of liff next app in my current directory. After some minutes later, there are these directories in the project.

> ls
README.md           app/                next-env.d.ts       next.config.js      node_modules/       package-lock.json   package.json        pages/              postcss.config.js   public/             styles/             tailwind.config.ts  tsconfig.json

Both pages/index.tsx and app/page.tsx exists there. it occurs a conflict error in next app. You can resolve it by just deleting pages/ directory. But let me report that issue here. Thank you so much.

inoue2002 commented 5 months ago

'npx @line/create-liff-app' is not yet supported on App router. If you are creating a liff app for the first time, I recommend pages router.

Papillon6814 commented 5 months ago

AH okay! I got it. thank you!

inoue2002 commented 1 month ago

Perhaps it might be helpful. https://zenn.dev/yu_ta_9/articles/d7ae415d776391