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]: Classic SSR + Rspack not work #4694

Closed
KyrieLii opened this issue Sep 20, 2023 · 5 comments
Closed

[Bug]: Classic SSR + Rspack not work #4694

KyrieLii opened this issue Sep 20, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@KyrieLii
Copy link
Member

KyrieLii commented Sep 20, 2023

Version

System:
    OS: macOS 12.5.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 684.16 MB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Browsers:
    Chrome: 117.0.5938.88
    Safari: 15.6.1
  npmPackages:
    @modern-js/app-tools: 2.35.0 => 2.35.0 
    @modern-js/builder-rspack-provider: 2.35.0 => 2.35.0 
    @modern-js/eslint-config: 2.35.0 => 2.35.0 
    @modern-js/runtime: 2.35.0 => 2.35.0 
    @modern-js/tsconfig: 2.35.0 => 2.35.0

Details

HMR not work when use SSR + Rspack.

Reproduce link

none

Reproduce Steps

Create a new project by npx @modern-js/create@latest :

? Please select the type of project you want to create: Web App
? Please select the programming language: TS
? Please select the package manager: pnpm
? Please select the bundler: Rspack (experimental)

Set server.ssr true:

import { appTools, defineConfig } from '@modern-js/app-tools';

// https://modernjs.dev/en/configure/app/usage
export default defineConfig<'rspack'>({
  runtime: {
    router: true,
  },
  server: {
    ssr: true,
  },
  plugins: [
    appTools({
      bundler: 'experimental-rspack',
    }),
  ],
});

Start the project and then change some thing in src/routes/page.tsx, but the page not update.

@KyrieLii KyrieLii added the bug Something isn't working label Sep 20, 2023
@chenjiahan
Copy link
Member

chenjiahan commented Sep 21, 2023

The reason for this problem is that the @loadable/babel-plugin plugin can not work correctly with Rspack, causing the loadableReady hook not to be executed.

We need to find an alternative to @loadable/babel-plugin in Rspack mode.

@chenjiahan
Copy link
Member

This problem only occurs when using Rspack + nested routes + SSR.

@KyrieLii KyrieLii changed the title [Bug]: HMR not work when using SSR + Rspack [Bug]: String SSR + Rspack not work Oct 26, 2023
@jkzing jkzing changed the title [Bug]: String SSR + Rspack not work [Bug]: Classic SSR + Rspack not work Oct 26, 2023
@GiveMe-A-Name GiveMe-A-Name self-assigned this Oct 30, 2023
@chenjiahan
Copy link
Member

related issue: web-infra-dev/rspack#4476

@chenjiahan
Copy link
Member

web-infra-dev/rspack#4476 has been resolved in Rspack v0.3.10

@GiveMe-A-Name Can you help to verify this issue? ❤️

@KyrieLii
Copy link
Member Author

I tried this before and it is fixed.
Thanks for your hard work @GiveMe-A-Name @chenjiahan 🫡

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants