MagnivOrg / prompt-layer-js

https://www.npmjs.com/package/promptlayer
MIT License
4 stars 4 forks source link

Cannot import library in SvelteKit/TypeScript #49

Open WilliamHua opened 8 months ago

WilliamHua commented 8 months ago

I started integrating PromptLayer and got this error.

Error when evaluating SSR module /Users/......+server.ts:

Internal server error: Failed to resolve entry for package "promptlayer". The package may have incorrect main/module/exports specified in its package.json.

This happens when I start importing PromptLayer using this

import { promptlayer } from "promptlayer";

This happens even if the file is just importing PromptLayer. Using SvelteKit + TypeScript

WilliamHua commented 8 months ago

Reproduction:

  1. https://github.com/WilliamHua/promptlayer-reproduction
  2. npm run dev
  3. Go to http://localhost:5173/sverdle

Importing prompt layer here - https://github.com/WilliamHua/promptlayer-reproduction/blob/main/src/routes/sverdle/%2Bpage.server.ts

Screenshot 2024-03-09 at 2 08 45 PM
marcospolanco commented 1 week ago

I have the same problem. Using TypeScript and Vite. image