novu icon indicating copy to clipboard operation
novu copied to clipboard

fix(sdk): Use dist for sdk artifacts

Open rifont opened this issue 3 months ago • 2 comments

What changed? Why was the change needed?

  • The Echo SDK was published without pointing to the built artifacts, resulting in the error belo when attempting to use the SDK. This PR fixes the package.json to point to the built artifacts.
  • Update readme to reflect actual SDK API
  • Delete the sdk package pnpm-lock.yml, as the root pnpm-lock.yml should be used instead

Screenshots

Error when using latest @novu/sdk

> next dev --port=4000

   ▲ Next.js 14.1.0
   - Local:        http://localhost:4000
   - Environments: .env.local

 ✓ Ready in 2.8s
 ○ Compiling / ...
 ✓ Compiled / in 6.6s (5781 modules)
 ○ Compiling /api/echo ...
 ⨯ ./app/api/echo/route.ts:1:0
Module not found: Can't resolve '@novu/echo/next'
> 1 | import { serve } from "@novu/echo/next";
  2 | import { echo } from "../../echo/client";
  3 |
  4 | export const { GET, POST, PUT } = serve({ client: echo });

https://nextjs.org/docs/messages/module-not-found
 ⨯ ./app/api/echo/route.ts:1:0
Module not found: Can't resolve '@novu/echo/next'
> 1 | import { serve } from "@novu/echo/next";
  2 | import { echo } from "../../echo/client";
  3 |
  4 | export const { GET, POST, PUT } = serve({ client: echo });

https://nextjs.org/docs/messages/module-not-found
 ⨯ ./app/api/echo/route.ts:1:0
Module not found: Can't resolve '@novu/echo/next'
> 1 | import { serve } from "@novu/echo/next";
  2 | import { echo } from "../../echo/client";
  3 |
  4 | export const { GET, POST, PUT } = serve({ client: echo });

https://nextjs.org/docs/messages/module-not-found
<w> [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: ENOENT: no such file or directory, rename '/Users/rifont/git/lightonia-app/.next/cache/webpack/client-development-fallback/0.pack.gz_' -> '/Users/rifont/git/lightonia-app/.next/cache/webpack/client-development-fallback/0.pack.gz'
<w> [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: ENOENT: no such file or directory, rename '/Users/rifont/git/lightonia-app/.next/cache/webpack/client-development-fallback/0.pack.gz_' -> '/Users/rifont/git/lightonia-app/.next/cache/webpack/client-development-fallback/0.pack.gz'
 ✓ Compiled /_error in 948ms (3006 modules)
^C
Expand for optional sections

Related enterprise PR

Special notes for your reviewer

rifont avatar May 16 '24 21:05 rifont