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

The requested module 'usehooks-ts' is a CommonJS module, which may not support all module.exports as named exports. #162

Closed
ShravanSunder opened this issue May 27, 2022 · 3 comments

Comments

@ShravanSunder
Copy link

ShravanSunder commented May 27, 2022

Hi, i'm getting issues when i use a package that uses usehooks-ts as a dependency.

I'm wondering if i need to have any settings? i thought usehooks-ts was a esm module now? @juliencrn

@ShravanSunder
Copy link
Author

@juliencrn
Copy link
Owner

Hi @ShravanSunder, thanks for reporting issue

Yes, current usehooks-ts should be ESM (as well as in the eth-hooks package, it should work.
And yes, it's related with #97 which we are working on.

@pencilcheck
Copy link

pencilcheck commented Dec 12, 2023

Still getting this error at 2.9.1

My tsconfig.json

{
  "compilerOptions": {
    "strict": true,
    "module": "ES2020",
    "target": "ES2020",
    // Doesn't apply to server/, see ts-node config down below and server/tsconfig.json
    "moduleResolution": "Bundler",
    "lib": ["DOM", "DOM.Iterable", "ESNext"],
    "types": ["vite/client"],
    "jsx": "react-jsx",
    "skipLibCheck": true,
    "esModuleInterop": true
  },
  "ts-node": {
    "transpileOnly": true,
    "esm": true,
    "compilerOptions": {
      "module": "Node16",
      "moduleResolution": "Node16"
    }
  }
}

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

3 participants