anchorme.js icon indicating copy to clipboard operation
anchorme.js copied to clipboard

anchorme is not a function

Open linweigao opened this issue 3 years ago • 3 comments

Error: const retVal = anchorme(input); ^

TypeError: anchorme is not a function

`import anchorme from "anchorme"

// const html = "www.instagram.com" // const retVal = anchorme({ input: html, options: { attributes: { target: "_blank" } } })

console.log(anchorme)

const input = "some text with a link.com"; const retVal = anchorme(input);

console.log(retVal)`

anchorme version 2.1.2

linweigao avatar Jul 31 '21 05:07 linweigao

The same issue in prod build using vite

nkeyy0 avatar Jan 19 '24 11:01 nkeyy0

Note: version < 3 works fine, but once I updated version to > 3 it works fine locally, but fails in production build.

Vite: 4.5.1 Anchorme: 3.0.5 Fails in all browsers I've tried

nkeyy0 avatar Jan 19 '24 11:01 nkeyy0

Looks like the issue that wrapper.mjs developed to handle only node environment, not the browser's

nkeyy0 avatar Jan 19 '24 12:01 nkeyy0