T
TanStack•4mo ago
other-emerald

pixi.js & pixi-viewport

Heyo! I seem to be running into an issue with pixi-viewport package:
[vite] Named export 'Viewport' not found. The requested module 'pixi-viewport' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'pixi-viewport';
const {Viewport} = pkg;
[vite] Named export 'Viewport' not found. The requested module 'pixi-viewport' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'pixi-viewport';
const {Viewport} = pkg;
I also did as the message suggested but I then get:
Class extends value undefined is not a constructor or null
Class extends value undefined is not a constructor or null
By itself, pixi works fine without any erros, just adding this viewport package then causes this error, it still works but it can sometimes not initialize. Is there a way I can force client render for this specific route? Thanks 🙂
1 Reply
genetic-orange
genetic-orange•4mo ago
You can try set ssr: false, on the router. there is also a clientOnly component : https://tanstack.com/router/latest/docs/framework/react/api/router/clientOnlyComponent#props

Did you find this page helpful?