recombee / js-api-client

JavaScript client for easy use of the Recombee recommendation API from frontend
23 stars 11 forks source link

Module not found: Can't resolve 'recombee-js-api-client' #17

Closed sharkfabri closed 10 months ago

sharkfabri commented 11 months ago

I installed the module version 4.1.4 in my NextJs 14.0.3 project and I have this error: Module not found: Can't resolve 'recombee-js-api-client'

I tried to import in different ways than import recombee from 'recombee-js-api-client' and tried in a javascript project over my typescript one, but nothing seems to work.

DanielBreiner commented 11 months ago

Hi @sharkfabri, I wasn't able to reproduce the issue - the import works fine for me, both in JS and TS.

import recombee from 'recombee-js-api-client'
const recombee = new recombee.ApiClient(/* ... */);
// or using named imports
import { ApiClient } from 'recombee-js-api-client'
const recombee = new ApiClient(/* ... */);

Could you please create and link a minimal reproduction repo?

DanielBreiner commented 10 months ago

Hi, I've managed to reproduce this - the issue was in the missing main field in package.json (or so I hope). A fix landed in v4.1.5. I will close this issue for now - please update the library and let me know if the issue persists.