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: Error Failed to load module for SSR #2781

Closed
RafidMuhymin opened this issue Mar 13, 2022 · 11 comments · Fixed by #2797
Closed

🐛 BUG: Error Failed to load module for SSR #2781

RafidMuhymin opened this issue Mar 13, 2022 · 11 comments · Fixed by #2797
Assignees

Comments

@RafidMuhymin
Copy link
Member

RafidMuhymin commented Mar 13, 2022

What version of astro are you using?

0.24.0

What package manager are you using?

pnpm

What operating system are you using?

Ubuntu

Describe the Bug

After upgrading to astro@0.24.0-next.1, I'm getting Failed to load module for SSR error. I am able to reproduce the issue even in the minimal starter. All the versions are working fine till astro@0.24.0-next.0. So, some code changes between the two versions may have caused the issue.

astro build

image

astro dev

image

But the main problem only a few users are experiencing this issue. Till now, three users have reported this issue. One of them is using Ubuntu, the other one Windows, and the other one Mac.

Link to Minimal Reproducible Example

https://stackblitz.com/github/withastro/astro/tree/latest/examples/minimal

@manishshahi1
Copy link

Getting same issue with minimal and every other template based installation such as svelte.

@matthewp matthewp self-assigned this Mar 14, 2022
@matthewp
Copy link
Contributor

Thanks everyone. For those who are seeing this problem, is it happening sporadically or does it always occur?

@manishshahi1
Copy link

I installed Astro a few days ago it was working fine. But since today I am getting the error.

@RafidMuhymin
Copy link
Member Author

@matthewp It's happening all the time.

@matthewp
Copy link
Contributor

Here's the diff between the versions where the regression was noticed: https://github.com/withastro/astro/compare/astro@0.24.0-next.0...astro%400.24.0-next.1

@matthewp
Copy link
Contributor

@manishshahi1 can you share your OS version and Node version?

@matthewp
Copy link
Contributor

@manishshahi1 Are you using pnpm by chance?

@matthewp
Copy link
Contributor

I'm able to recreate this now, it's related to the fact that there is a space in your filepath.

I think it's probably this bug: vitejs/vite-plugin-vue#218

@colinthedev
Copy link

This error can also occur if the filepath for an import does not match what it should be.

@patrick91
Copy link

This error can also occur if the filepath for an import does not match what it should be.

Yes! thanks! I forgot to add .astro in an import inside an MDX file

@marcelocra
Copy link

This error can also occur if the filepath for an import does not match what it should be.

Wow.. I didn't even noticed that .astro imports were different than React ones:

-import { AstroComponent } from "../path/to/AstroComponent";
+import AstroComponent from "../path/to/AstroComponent.astro";

Solved for me, thanks!

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.

6 participants