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

🐛 BUG: @astrojs/image types are wacky #3967

Closed
1 task
FredKSchott opened this issue Jul 18, 2022 · 0 comments · Fixed by #3980
Closed
1 task

🐛 BUG: @astrojs/image types are wacky #3967

FredKSchott opened this issue Jul 18, 2022 · 0 comments · Fixed by #3980
Assignees

Comments

@FredKSchott
Copy link
Member

What version of astro are you using?

latest

Are you using an SSR adapter? If so, which one?

none

What package manager are you using?

pnpm

What operating system are you using?

mac

Describe the Bug

https://unpkg.com/browse/@astrojs/image@0.1.2/dist/

Type files aren't built to dist/types.d.ts. Instead, they're built to dist/src/types.d.ts. This appears to be caused by this line in src/types.ts:

export type { Image, Picture } from '../components/index.js';

Unfortunately, you can't import outside of src without causing weird behavior like this. Can we construct these types ourselves? Something like this pseudocode:

import {AstroComponentFactory} from 'astro';
export type Image = AstroComponentFactory<...>;
export type Picture = AstroComponentFactory<...>;

To reproduce:

Run build inside of the integrations/image folder with a clear dist folder.

Link to Minimal Reproducible Example

See above

Participation

  • I am willing to submit a pull request for this issue.
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 a pull request may close this issue.

2 participants