Recently I created a npm package and published as a npm package - head-meta https://www.npmjs.com/package/head-meta. This has a support to work with CommonJS enviroment as well as ES6 Module environment. It is working fine with my frontend application when running locally.
But after hosting the application along with the package I am getting this error -
index.DM33Gl2Y.js:13 Error fetching meta data: Error: eT.get is not a function
at as (index.DM33Gl2Y.js:13:184902)
at i (index.DM33Gl2Y.js:13:185838)
at yt (entry.DdIfzKgM.js:19:38)
at Ne (entry.DdIfzKgM.js:19:108)
at HTMLButtonElement.n (entry.DdIfzKgM.js:23:6911)
This is how I am using the package in ES6 Module -
import fetchHeadTags from 'head-meta';
const parseMeatData = async () => {
try {
const tags = await fetchHeadTags('https://www.pratikchakraborty.in/');
console.log(tags)
} catch (error) {
console.error('Error fetching meta data:', error.message);
}
};```
Please check the package to get more idea about the issue - (head-meta)
I tried to use it in a frontend application built with react, but it failed when the react application was hosted, locally iy was working fine and was able to return the data in the object, as defined in the library