grammyjs/conversations

Not works with Nextjs: Module not found: Default condition should be last one

STRRL opened this issue · 3 comments

STRRL commented

Hi! I am using grammy with nextjs, everything works well until I introduce the conversation plugin.

- error ./node_modules/.pnpm/@grammyjs+conversations@1.1.2_grammy@1.17.2/node_modules/@grammyjs/conversations/out/deps.node.js:18:14
Module not found: Default condition should be last one

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module:
./node_modules/.pnpm/@grammyjs+conversations@1.1.2_grammy@1.17.2/node_modules/@grammyjs/conversations/out/conversation.js
./node_modules/.pnpm/@grammyjs+conversations@1.1.2_grammy@1.17.2/node_modules/@grammyjs/conversations/out/mod.js
./bot/index.ts
./app/api/webhook/route.ts
- wait compiling /_error (client and server)...
- error ./node_modules/.pnpm/@grammyjs+conversations@1.1.2_grammy@1.17.2/node_modules/@grammyjs/conversations/out/deps.node.js:18:14
Module not found: Default condition should be last one

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module:
./node_modules/.pnpm/@grammyjs+conversations@1.1.2_grammy@1.17.2/node_modules/@grammyjs/conversations/out/conversation.js
./node_modules/.pnpm/@grammyjs+conversations@1.1.2_grammy@1.17.2/node_modules/@grammyjs/conversations/out/mod.js
./bot/index.ts
./app/api/webhook/route.ts

next version: 13.4.13

STRRL commented

That line is var o_son_1 = require("o-son");, I am not so sure with it would works with nextjs
image

This used to be a problem with a previous version of a dependency of the conversations plugin. Can you reinstall your deps, check that npm ls o-son points to o-son@1.0.2, and see if that fixed the problem?

Closing due to inactivity.