Skip to content

npm-only install of viewer/editor renders nothing on 0.9.x (nodeRegistry empty?) #454

Description

@bo-hyeon

What happened?

@pascal-app/viewer renders a completely empty scene after upgrading from 0.8.0 to 0.9.1 (clean npm install, not the monorepo) — no walls, windows, doors, roofs, nothing. No errors are thrown and the scene data is valid. Exporting via GLTFExporter confirms it: the output is basically empty (~384 bytes).

Digging a bit, it looks like nodeRegistry (@pascal-app/core) might be empty for npm-only consumers — NodeRenderer returns null when nodeRegistry.get(node.type) is undefined, and I couldn't find registerNode() being called anywhere outside test files in the published core/viewer/editor packages. @pascal-app/nodes also doesn't seem to be on npm (404).

Is this expected for npm-only setups, or is something missing from the published packages?

Versions: @pascal-app/core@0.9.1, @pascal-app/viewer@0.9.1, @pascal-app/editor@0.9.1

Steps to reproduce

'use client'

import { BuildingNode, LevelNode, SiteNode, WallNode, generateId, useScene } from '@pascal-app/core'
import dynamic from 'next/dynamic'
import { useEffect, useState } from 'react'

const Viewer = dynamic(() => import('@pascal-app/viewer').then((m) => ({ default: m.Viewer })), { ssr: false })

export default function Page() {
const [ready, setReady] = useState(false)

useEffect(() => {
const siteId = generateId('site')
const buildingId = generateId('building')
const levelId = generateId('level')
const wallId = generateId('wall')

const wallNode = WallNode.parse({ id: wallId, parentId: levelId, start: [0, 0], end: [5, 0] })
const levelNode = LevelNode.parse({ id: levelId, parentId: buildingId, children: [wallId], level: 0 })
const buildingNode = BuildingNode.parse({ id: buildingId, parentId: siteId, children: [levelId] })
const siteNode = SiteNode.parse({ id: siteId, children: [buildingId] })

useScene.getState().setScene(
  { [siteId]: siteNode, [buildingId]: buildingNode, [levelId]: levelNode, [wallId]: wallNode },
  [siteId]
)
setReady(true)

}, [])

return <div style={{ position: 'fixed', inset: 0 }}>{ready && }
}

Expected behavior

The wall defined in the repro (start: [0, 0], end: [5, 0]) should render as a visible 3D wall mesh in the <Viewer> canvas, same as it did on 0.8.0.

Browser & OS

Chrome, Windows 11

Screenshots or screen recordings

No response

Additional context

The bundled READMEs for @pascal-app/core and @pascal-app/viewer (and the repo root README) still describe the pre-registry architecture and don't mention @pascal-app/nodes at all, so there's currently no documented way for an npm-only consumer to get a working scene.

This seems related to PR #314 ("Node registry & plugin-ready architecture"), which moved all per-kind rendering logic into a new @pascal-app/nodes package and removed the old hardcoded dispatch from viewer/editor.

Note: the WallNode example in the README uses points: which isn't even a valid field in the current schema — the READMEs appear not to have been updated alongside the 0.9.x refactor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions