-
Notifications
You must be signed in to change notification settings - Fork 29
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
package.json should be updated to support TypeScripts bundler module resolution #247
Comments
It looks like somehow we aren't shipping TypeScript types at all, so we should probably fix that too 😅. |
We need to copy the entrypoing typings file, as described in [the TypeScript docs]: > It’s important to note that the CommonJS entrypoint and the ES > module entrypoint each needs its own declaration file, even if the > contents are the same between them. Every declaration file is > interpreted either as a CommonJS module or as an ES module, based on > its file extension and the `"type"` field of the `package.json`, and > this detected module kind must match the module kind that Node will > detect for the corresponding JavaScript file for type checking to be > correct. Attempting to use a single `.d.ts` file to type both an ES > module entrypoint and a CommonJS entrypoint will cause TypeScript to > think only one of those entrypoints exists, causing compiler errors > for users of the package. [the TypeScript docs]: https://www.typescriptlang.org/docs/handbook/esm-node.html Closes #247
We need to copy the entrypoing typings file, as described in [the TypeScript docs]: > It’s important to note that the CommonJS entrypoint and the ES > module entrypoint each needs its own declaration file, even if the > contents are the same between them. Every declaration file is > interpreted either as a CommonJS module or as an ES module, based on > its file extension and the `"type"` field of the `package.json`, and > this detected module kind must match the module kind that Node will > detect for the corresponding JavaScript file for type checking to be > correct. Attempting to use a single `.d.ts` file to type both an ES > module entrypoint and a CommonJS entrypoint will cause TypeScript to > think only one of those entrypoints exists, causing compiler errors > for users of the package. [the TypeScript docs]: https://www.typescriptlang.org/docs/handbook/esm-node.html Closes #247
We need to copy the entrypoing typings file, as described in [the TypeScript docs]: > It’s important to note that the CommonJS entrypoint and the ES > module entrypoint each needs its own declaration file, even if the > contents are the same between them. Every declaration file is > interpreted either as a CommonJS module or as an ES module, based on > its file extension and the `"type"` field of the `package.json`, and > this detected module kind must match the module kind that Node will > detect for the corresponding JavaScript file for type checking to be > correct. Attempting to use a single `.d.ts` file to type both an ES > module entrypoint and a CommonJS entrypoint will cause TypeScript to > think only one of those entrypoints exists, causing compiler errors > for users of the package. [the TypeScript docs]: https://www.typescriptlang.org/docs/handbook/esm-node.html Closes #247
@nex3 Just saw you finally released this update, but this still isn't working unfortunately. The paths do not seem to be correct either? From your
I can only find types under |
The latest release did not work: https://github.com/sass/embedded-host-node/actions/runs/6489515014/job/17624098258 |
@nex3 1.69.3 wasn't released due to the following issue. I think we should reopen this and try again?
|
😩 |
I think it's working now, thanks @nex3! |
I am trying to use TypeScripts
"moduleResolution": "Bundler"
-feature and I'm blocked by thesass-embedded
-package.This is the error that I'm getting from TypeScript:
From what I can gather it seems that it is no longer enough to specify
"types": "dist/types/index.d.ts"
, the package file should also include the types in exports as well.The text was updated successfully, but these errors were encountered: