IABTechLab / iabgpp-es

Apache License 2.0
25 stars 8 forks source link

Unable to load modules in package #10

Closed nealrosen closed 1 year ago

nealrosen commented 1 year ago

I am trying to integrate the stub and cmpapi modules into our CMP, but I am not able to access those modules from javascript. I get a "module not found" error.

This package seems to only be available as "iabgpp" and can be installed by running "npm i iabgpp". I was expecting to be able to install @iabgpp/cmpapi and @iabgpp/stub as individual packages, similarly to the @iabtcf modules.

Is this not being published to npm correctly?

nealrosen commented 1 year ago

I see that the @iabgpp/stub and @iabgpp/cmpapi modules have been individually published now. Thanks! However, I am now seeing a different error, which I believe is due to the index.js files being excluded in the published packages. The error is "Can't resolve '@iabgpp/cmpapi'" error.

The error message also includes message showing that it is trying to find the main index file. I manually added the index file in lib/mjs, which resulted in different error messages related to the other directories missing index files.

nealrosen commented 1 year ago

After manually copying all of the index files into the installed package in my CMP project's node_modules directory, and correcting some typos in those index files, the API seems to be working.

chuff commented 1 year ago

Fixed in version 3.0.5.

nealrosen commented 1 year ago

Confirmed. Thanks!