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

Static SSR not functional in v4 #135

Closed
Rid opened this issue Nov 2, 2018 · 4 comments
Closed

Static SSR not functional in v4 #135

Rid opened this issue Nov 2, 2018 · 4 comments

Comments

@Rid
Copy link

Rid commented Nov 2, 2018

🐛 Bug Report

When following the server-side readme and using the recommended static method we end up with the following error when trying to start our dev environment:

Invariant Violation: loadable: cannot find loadable-Home in manifest

It appears that the manifest is not being populated properly.

To Reproduce

Steps to reproduce the behavior:
Clone our repo: git clone https://github.com/Rid/react-cool-starter.git

and run git checkout feature/loadable-components-v4 && yarn install && yarn dev

Expected behavior

It should render the Home component.

Link to repl or repo (highly encouraged)

The project itself is a minimal starter kit: https://github.com/Rid/react-cool-starter/tree/feature/loadable-components-v4

Run npx envinfo --system --binaries --npmPackages @loadable/component,@loadable/server,@loadable/webpack-plugin,@loadable/babel-plugin --markdown --clipboard

Paste the results here:

## System:
 - OS: macOS 10.14
 - CPU: x64 Intel(R) Core(TM) i7-4558U CPU @ 2.80GHz
 - Memory: 195.86 MB / 16.00 GB
 - Shell: Unknown - /usr/local/bin/fish
## Binaries:
 - Node: 8.10.0 - ~/.nvm/versions/node/v8.10.0/bin/node
 - Yarn: 1.3.2 - /usr/local/bin/yarn
 - npm: 5.6.0 - ~/.nvm/versions/node/v8.10.0/bin/npm
## npmPackages:
 - @loadable/babel-plugin: ^4.0.5 => 4.0.5 
 - @loadable/component: ^4.0.2 => 4.0.2 
 - @loadable/server: ^4.0.5 => 4.0.5 
 - @loadable/webpack-plugin: ^4.0.5 => 4.0.5 
@gregberge
Copy link
Owner

Hello @Rid, first thank you for your issue.

I can’t checkout the project right now, but I gave a quick look. For me your problem is that you are using "webpack-dev-middleware" and you are reading manifest from a file. So the manifest is not synced.

The simplest solution for your problem is to use read the manifest from the virtual file system of "webpack-dev-middleware".

I think it is your problem, but tell me if I am wrong.

@Rid
Copy link
Author

Rid commented Nov 5, 2018

@neoziro the webpack-dev-middleware manifest only contains { main: [ 'main.css', 'main.js' ] } it looks like the code splitting is not working as the chunk files are not written to the disk either.

I'll have another look over the readme with fresh eyes, do you see any other issues?

@gregberge
Copy link
Owner

Please be patient, I will work on a new v5 that should be better for SSR.

@gregberge gregberge added the bug label Nov 6, 2018
@gregberge
Copy link
Owner

SSR has been completely rebuilt in v5, can you please give it a try? 🙏

I close this issue because it is now outdated.

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

2 participants