Comments (5)
hmm also seems eslint doesn't like it:
error Unable to resolve path to module 'react-use-clipboard' import/no-unresolved
seems to build fine though
from react-use-clipboard.
Hey @wroughtec — Thanks for the issue. I'm not able to reproduce this one.
Can you see if the package exists in your package.json
, yarn.lock
or package-lock.json
, and node_modules
folder?
from react-use-clipboard.
yes is in the lock file & node_modules:
[email protected]:
version "0.1.3"
resolved "https://registry.yarnpkg.com/react-use-clipboard/-/react-use-clipboard-0.1.3.tgz#46dfbdb08586d1335970a7fdd88383ec64b95dc4"
integrity sha512-EDKKJpduJtqpEDLXPdqcoQszTGyctg8V7tO8DWPAUFDnZOvfVA/EfTCYzugrpRS3ikeFbBbR8MrBrHJ2DhhqGg==
dependencies:
copy-to-clipboard "^3.0.8"
Eslint config as below:
const path = require('path');
module.exports = {
extends: [
'plugin:cypress-dev/general',
'plugin:cypress-dev/tests',
'plugin:cypress-dev/react',
'plugin:import/typescript',
'plugin:@typescript-eslint/recommended',
'airbnb',
'prettier',
'prettier/@typescript-eslint',
'prettier/react'
],
plugins: [
'html',
'import',
'eslint-plugin-env',
'react-hooks',
'jasmine',
'cypress',
'chai-friendly',
'@typescript-eslint',
'prettier'
],
globals: { google: true, analytics: true },
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
jsx: true
},
tokens: true
},
env: {
es6: true,
browser: true,
node: true,
jest: true,
jasmine: true,
serviceworker: true,
'cypress/globals': true
},
rules: {},
settings: {
'import/resolver': {
'babel-module': {},
typescript: {},
node: true,
'eslint-import-resolver-typescript': true
}
},
overrides: [
{
files: ['**/__tests__/**'],
settings: {
'import/resolver': {
jest: {
jestConfigFile: path.join(__dirname, './jest.config.js')
}
}
}
},
{
files: ['**/__tests__/*.test.ts', '**/__tests__/*.test.tsx'],
rules: {
'@typescript-eslint/explicit-function-return-type': 0
}
}
]
};
jest config:
const path = require('path');
module.exports = {
verbose: true,
rootDir: './src',
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'json'],
transform: {
'^.+\\.(js|jsx)$': 'babel-jest',
'^.+\\.(ts|tsx)$': 'babel-jest'
},
transformIgnorePatterns: ['[/\\\\]node_modules/\\\\].+\\.(js|jsx|ts|tsx)$', '\\.(css|scss|sass|less)$'],
coveragePathIgnorePatterns: ['./public/', './node_modules/'],
setupFiles: ['./testsSetup/setupTests.js', 'jest-localstorage-mock'],
globals: {
TZ: 'UTC'
},
moduleDirectories: ['node_modules', 'src', 'testUtils', __dirname],
collectCoverageFrom: [],
reporters: ['default', 'jest-junit'],
watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname', 'jest-watch-select-projects'],
setupFilesAfterEnv: ['./testsSetup/extendJest.js'],
moduleNameMapper: {
'\\.(css|scss|sass|less)$': 'identity-obj-proxy',
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/__mocks__/fileMock.js'
}
};
Tried on both Mac and ubuntu same error rolling back to 0.1.2 resolves, its probably something in my config
from react-use-clipboard.
@wroughtec — Not too sure what the issue is. Happy to help debug if there's a reproduction I can clone locally.
I just published version 0.1.4
which adopts TypeScript. It's possible that the new version accidentally also fixes the issue you're running into.
from react-use-clipboard.
Yep fixed my issue 👍
from react-use-clipboard.
Related Issues (10)
- Error on Firefox HOT 1
- Can't import the named export 'useState' from non EcmaScript module (only default export is available) HOT 2
- copy-to-clipboard mutates DOM directly HOT 1
- SyntaxError: Cannot use import statement outside a module HOT 4
- Add "exports" field to package.json for modern JS
- How to copy mutable text? HOT 8
- isCopied is not reactive to other objects being copied. HOT 3
- Ignore `example/.next` with Prettier
- Types not working HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-use-clipboard.