Skip to content

Production React SSR build manifest is wrong if a page depends on @blueprintjs/core #64

Open
@targos

Description

@targos

Package version

3.1.0

Describe the bug

Here's a repro:

npm init adonisjs@latest -- --K=inertia --adapter=react --ssr --auth-guard=basic_auth --db=sqlite repro
cd repro
# force just to bypass react peer dependency error. this can be reproduced with react 18 too.
npm i @blueprintjs/core --force
echo "import { Button } from '@blueprintjs/core'\n\nexport default function Test() { return <Button>Test</Button> }" > inertia/pages/home.tsx
npm run build
cd build
cp ../.env .env
# Edit the .env to have NODE_ENV=production
node bin/server.js
# Then access http://localhost:3333
# Error: Cannot find \"inertia/pages/home.tsx\" chunk in the manifest file

The problem is that the manifest (build/public/assets/.vite/manifest.json) doesn't contain an entry for the home.tsx page. It should have a key named "inertia/pages/errors/home.tsx".

If you add another unrelated page that also uses @blueprintjs/core, it suddenly works again (both pages end up in the manifest).

I'm opening this because I have no idea where to start debugging the problem. It already took me a very long time to understand the cause.

Reproduction repo

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions