question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Umi4 SSR doesn't work?

See original GitHub issue

Hi,

Couldn’t make SSR working while migrating from Umi3 to Umi4 (4.0.8), if I added the ssr key into config (.umirc.js) this way:

export default {
    svgr: {},

    ssr: {
        serverBuildPath: './dist/umi.server.js'
    }
};

No change if I put it in a basic way:

export default {
    svgr: {},

    ssr: {}
};

umi dev and umi setup throw an error

> umi-ssr@2.0.0 run
> umi dev

fatal - Error: Parse error @:26:41
    at parse (/Projects/umi/umi-ssr/node_modules/@umijs/bundler-utils/compiled/es-module-lexer/index.js:1:511)
    at parseModuleSync (/Projects/umi/umi-ssr/node_modules/@umijs/bundler-utils/dist/index.js:46:43)
    at parseModule (/Projects/umi/umi-ssr/node_modules/@umijs/bundler-utils/dist/index.js:36:10)
    at async getModuleExports (/Projects/umi/umi-ssr/node_modules/@umijs/preset-umi/dist/features/tmpFiles/getModuleExports.js:29:24)
    at async getRoutes (/Projects/umi/umi-ssr/node_modules/@umijs/preset-umi/dist/features/tmpFiles/routes.js:107:78)
    at async Hook.fn (/Projects/umi/umi-ssr/node_modules/@umijs/preset-umi/dist/features/appData/appData.js:37:19)
    at async /Projects/umi/umi-ssr/node_modules/@umijs/core/dist/service/service.js:114:25 {
  idx: 569
}

my package.json is like this:

{
  "name": "umi-ssr",
  "version": "2.0.0",
  "main": "index.js",
  "license": "MIT",
  "private": true,
  "scripts": {
    "postinstall": "umi setup",
    "run": "umi dev",
    "build": "umi build --clean"
  },
  "dependencies": {
    "ahooks": "^3.6.2",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "umi": "^4.0.8",
    "unirest": "^0.6.0"
  },
  "devDependencies": {
    "@umijs/plugins": "^4.0.8",
    "express": "^4.18.1"
  }
}

Is ssr still a part of UmiJs, or it was removed? Because I don’t see it listed on https://umijs.org/docs/api/config either…

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
sorrycccommented, Jul 29, 2022

Please provide a minimal reproduction. @skitsanos

0reactions
skitsanoscommented, Jul 29, 2022

@sorrycc, here is the demo branch with an issue https://github.com/skitsanos/umi-ssr/tree/umi4

Read more comments on GitHub >

github_iconTop Results From Across the Web

Server-side rendering broken after upgrading to MUI 5 (with ...
I launched the official SSR Next.js implementation. It showed it doesn't work either. Server-side rendering with JavaScript disabled. For more ...
Read more >
hint: if you don't want pnpm to fail on peer dependency issues, add ...
Following the guidelines in CONTRIBUTING.md, I run pnpm install and it seems to finish- but it does have some peer dependency issues:.
Read more >
Zehel - Umi's Birthday "Brilliant Jewelry" Box Scouting! [Mar 9, 12am ...
•50 cards (1 Brilliant Jewelry UR Umi, 4 SSR, 45 SR) •Paid Scout •Reset box indefinitely ... •100 cards (1 random Birthday UR...
Read more >
Using Non-SSR Friendly Components with Next.js
But, there can be instances where you will not need SSR for one or more Next.js ... when working with applications that use...
Read more >
Server Side Rendering - Emotion
The default approach works with streaming and requires no additional configuration, but does not work with nth child or similar selectors.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found