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: Partial hydration requires import path with an extension #608

Closed
kolodziejczak-sz opened this issue Jul 6, 2021 · 2 comments
Closed

Comments

@kolodziejczak-sz
Copy link

What package manager are you using?

yarn

What operating system are you using?

Windows

Describe the Bug

Partial hydration requires import path with an extension, otherwise it won't work.

This violates the typescript rule TS2691: An import path cannot end with a '.tsx' extension

Steps to Reproduce

  1. Create a tsx component
  2. Import the component without extension, for example import Component from './component';
  3. Use Partial Hydration, for example <MyComponent:load />
  4. 404, Component not found

Link to Minimal Reproducible Example (Optional)

No response

@jasikpark
Copy link
Contributor

jasikpark commented Sep 8, 2021

microsoft/TypeScript#35589 (comment)

I believe this would be more of an RFC, rather than an immediate BUG, since requiring .tsx | .jsx | .vue is imperative for resolving between different component types.

Typescript has said they are intent on not rewriting imports because they want all typescript code to be copy-pasteable as javascript..

Deno does not have this requirement, and in fact has the same imports as Astro does:

So I think this is something to sort out what makes the most sense!

@FredKSchott
Copy link
Member

Thanks for the report! We believe that this has been fixed in astro v0.21, going out today. Let us know if you can still reproduce the issue after updating to v0.21 and we'll be happy to take a look.

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