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

houdini adapter not loading CSS (or any other SSR component for that matter) #629

Closed
sjcobb2022 opened this issue Oct 22, 2022 · 5 comments · Fixed by #630
Closed

houdini adapter not loading CSS (or any other SSR component for that matter) #629

sjcobb2022 opened this issue Oct 22, 2022 · 5 comments · Fixed by #630

Comments

@sjcobb2022
Copy link
Contributor

sjcobb2022 commented Oct 22, 2022

Describe the bug

Whilst trying to update to 0.17.0 I have a significant bug in which my CSS does not load. After testing both with and without houdini, I have come to the conclusion that it is the houdini adapter that is causing this issue.

I currently have a styles.css in the routes directory of my sveltekit project which contains the necessary tailwind imports to enable tailwind to work. However after upgrading, I received the error that it failed to load modules for ssr. Without houdini installed, the same code works just fine.

I believe that it is because of the rewrite of the adapter. Not sure why this is needed (would love to know), but it worked fine before.

Severity

blocking all usage of Houdini

Steps to Reproduce the Bug

  1. clone https://github.com/sjcobb2022/houdini-broken-example
  2. npm run dev -- --open

Error:

Sourcemap for "/src/routes/+layout.svelte" points to missing source files
failed to load module for ssr: ./styles.css
Error: failed to load module for ssr: ./styles.css

Bear in mind that if the line in +layout.svelte is switched:

e.g.

<script>
	import Header from './Header.svelte';
	import './styles.css';
</script>

The error would say

Sourcemap for "/src/routes/+layout.svelte" points to missing source files
failed to load module for ssr: ./Header.svelte
Error: failed to load module for ssr: ./Header.svelte

Meaning that this is a much larger error that just CSS not loading. I believe that anything related to SSR is pretty much broken.

Reproduction

No response

@sjcobb2022 sjcobb2022 changed the title houdini adapter not loading CSS houdini adapter not loading CSS (or any other SSR component for that matter) Oct 22, 2022
@AlecAivazis
Copy link
Collaborator

AlecAivazis commented Oct 22, 2022

Huh, that's strange. Our e2e test work locally and on my machine so I don't think SSR is broken. That being said, the core logic is the same before and after the refactoring so I suspect there is a bug in the windows comparability work that's preventing the plugin from seeing the existing layout file.

edit: just saw that link. thanks! i'll take a look now

@sjcobb2022
Copy link
Contributor Author

I'm on Linux.

The e2e test don't include a local app.css file I don't think.

@AlecAivazis
Copy link
Collaborator

I'm on Linux.

Okay, thanks for the info. The reason I brought up the windows thing was to explain why the logic changed between 0.16.8 and 0.17.0. Assuming that's what you meant by "adapter". Anyway, I reproduced your issue in the example. Will try to have a fix for you by the end of the night

@sjcobb2022
Copy link
Contributor Author

I'm on Linux.

Okay, thanks for the info. The reason I brought up the windows thing was to explain why the logic changed between 0.16.8 and 0.17.0. Assuming that's what you meant by "adapter". Anyway, I reproduced your issue in the example. Will try to have a fix for you by the end of the night

Ah that makes sense. Thank you so much.

Btw I'm about 30% complete with the type generation so should be a few more days. Been really sick tho so idk.

@AlecAivazis
Copy link
Collaborator

AlecAivazis commented Oct 22, 2022

I have a fix! This was a super subtle issue. Ended up figure out what was happening by sprinkling in a bunch of console.log inside vite's bundled source. ran into a few places with an ominous "should never be here" vibe. Anyway, The issue was affecting any relative imports in the root layout which work now and there's no more of that annoying error about the source map.

Thanks for submitting this!

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