Skip to content

package.json: list type exports. - #3915

Merged
SteffenDE merged 1 commit into
phoenixframework:mainfrom
kivikakk:push-uzywtputqrly
Jul 31, 2025
Merged

package.json: list type exports.#3915
SteffenDE merged 1 commit into
phoenixframework:mainfrom
kivikakk:push-uzywtputqrly

Conversation

@kivikakk

Copy link
Copy Markdown
Contributor

Without something like this, we get the following when using moduleResolution "bundler":

js/app.ts:3:34 - error TS7016: Could not find a declaration file for module 'phoenix_live_view'.
'[...]/node_modules/phoenix_live_view/priv/static/phoenix_live_view.esm.js' implicitly has an 'any' type.

  There are types at '[...]/node_modules/phoenix_live_view/assets/js/types/index.d.ts', but this result
  could not be resolved when respecting package.json "exports". The 'phoenix_live_view' library may need
  to update its package.json or typings.

3 import { Hook, LiveSocket } from "phoenix_live_view"
                                   ~~~~~~~~~~~~~~~~~~~

I'm not confident this is the correct solution for all cases, but I do confirm it means my types resolve correctly!

Comment thread package.json Outdated
Without something like this, we get the following when using
moduleResolution "bundler":

```
js/app.ts:3:34 - error TS7016: Could not find a declaration file for module 'phoenix_live_view'.
'[...]/node_modules/phoenix_live_view/priv/static/phoenix_live_view.esm.js' implicitly has an 'any' type.

  There are types at '[...]/node_modules/phoenix_live_view/assets/js/types/index.d.ts', but this result
  could not be resolved when respecting package.json "exports". The 'phoenix_live_view' library may need
  to update its package.json or typings.

3 import { Hook, LiveSocket } from "phoenix_live_view"
                                   ~~~~~~~~~~~~~~~~~~~
```
@kivikakk
kivikakk force-pushed the push-uzywtputqrly branch from 7659746 to ca0892d Compare July 31, 2025 10:30
@SteffenDE
SteffenDE merged commit 3771447 into phoenixframework:main Jul 31, 2025
7 checks passed
@SteffenDE

Copy link
Copy Markdown
Member

🙌🏻

@kivikakk
kivikakk deleted the push-uzywtputqrly branch July 31, 2025 13:31
@kivikakk

Copy link
Copy Markdown
Contributor Author

Thank you! 🤍

SteffenDE pushed a commit that referenced this pull request Jul 31, 2025
Without something like this, we get the following when using
moduleResolution "bundler":

```
js/app.ts:3:34 - error TS7016: Could not find a declaration file for module 'phoenix_live_view'.
'[...]/node_modules/phoenix_live_view/priv/static/phoenix_live_view.esm.js' implicitly has an 'any' type.

  There are types at '[...]/node_modules/phoenix_live_view/assets/js/types/index.d.ts', but this result
  could not be resolved when respecting package.json "exports". The 'phoenix_live_view' library may need
  to update its package.json or typings.

3 import { Hook, LiveSocket } from "phoenix_live_view"
                                   ~~~~~~~~~~~~~~~~~~~
```
@SteffenDE

Copy link
Copy Markdown
Member

Released in 1.1.2!

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

Successfully merging this pull request may close these issues.

2 participants