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

Types could not be resolved when using "moduleResolution: "Bundler" in tsconfig. #99

Closed
thanawatarista opened this issue Aug 17, 2023 · 3 comments
Labels

Comments

@thanawatarista
Copy link

Expected Behavior

Types to be resolved.

Actual Behavior

The types for this package could not be resolved when using the "moduleResolution": "bundler" in your TSConfig.

See:
image

This is the issue:

Steps to Reproduce the Problem

  1. Set "moduleResolution": "bundler" in "compileOptions".
  2. Try to typecheck by doing tsc --noEmit
  3. See that the build failed.

The fix is to change this package's package.json, line: https://github.com/iam-medvedev/esbuild-plugin-less/blob/main/package.json#L30
to:

  "exports": {
    "import": {
      "default": "./build/esm.mjs",
      "types": "./build/index.d.ts"
    },
    "require": {
     "default": "./build/cjs.js",
     "types": "./build/index.d.ts"
    }
  },

Versions

  • esbuild: 0.18.10
  • esbuild-plugin-less: 1.2.3
  • Platform:
@github-actions
Copy link

🎉 This issue has been resolved in version 1.2.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@iam-medvedev
Copy link
Owner

Thank you @thanawatarista!

@thanawatarista
Copy link
Author

Thanks for fixing this so quickly @iam-medvedev !

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

No branches or pull requests

2 participants