Badisi/samsung-tv-remote

[BUG] Module not found: Default condition should be last one

Closed this issue ยท 3 comments

Is there an existing issue for this?

  • I have searched the existing issues

Library version

v2.0.7

Description

Cant use built version of package in NextJS app. No problems with including sources
The Error i receive is:

Module not found: Default condition should be last one
  1 |
  2 | import { NextResponse } from "next/server";
> 3 | import { SamsungTvRemote, Keys } from 'samsung-tv-remote';
    | ^
  4 |
  5 | export async function POST() {

Steps to reproduce

npx create-next-app@latest
npm install samsung-tv-remote --save

create api/route.ts and
import { SamsungTvRemote, Keys } from 'samsung-tv-remote';

Environment

  • Windows 11
  • PC
  • npm v10.2.3
  • Node v18.19.0

Good catch!

According to the doc:

Within the "exports" object, key order is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. The general rule is that conditions should be from most specific to least specific in object order.

Didn't know that, thanks for the report ๐Ÿ˜‰

๐Ÿš€ Released in samsung-tv-remote@2.1.0

๐ŸŽ‰