ericclemmons / ericclemmons/unique-selector

TypeError: unique is not a function

Open
#56 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
272
Forks
55
PR merge metrics
No merged PRs in 30d

Description

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 = 'Some text';
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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.