Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: unique is not a function #56

Open
DevLab2425 opened this issue Mar 22, 2022 · 0 comments
Open

TypeError: unique is not a function #56

DevLab2425 opened this issue Mar 22, 2022 · 0 comments

Comments

@DevLab2425
Copy link

Following the first example in the README, I get a TypeError

TypeError: unique is not a function

Here is the sample file I've created:

index.js

import unique from 'unique-selector';

const DOM = '<span id="test" class="nav-item" aria-label="something">Some text</span>';
const options = {
    selectorTypes : [ 'ID', 'Class', 'Tag', 'NthChild' ]
}

console.log(typeof unique, JSON.stringify(unique)); // "object", {}
unique( DOM, options );

And here is the full error message

Error message

TypeError: unique is not a function
    at file:///Users/path/to/project/unique-selector-poc/index.js:10:1
    at ModuleJob.run (internal/modules/esm/module_job.js:146:23)
    at async Loader.import (internal/modules/esm/loader.js:165:24)
    at async Object.loadESM (internal/process/esm_loader.js:68:5)

package.json

{
  "name": "unique-selector-poc",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "dependencies": {
    "unique-selector": "0.5.0"
  },
  "type": "module"
}

Please help me identify where I'm going wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant