fix: resolve ember-raf-scheduler to its ESM addon source for the lots-of-data demo#180
Merged
NullVoxPopuli merged 2 commits intomainfrom Feb 25, 2026
Merged
Conversation
…page
ember-raf-scheduler v0.3 is a v1 Ember addon that only ships a CJS
ember-addon index.js with no proper ESM exports. When vite pre-bundles
@html-next/vertical-collection, it wraps the CJS file using __commonJS
but incorrectly transforms `require('./package')` into
`window.require('./package')`, which fails in the browser with
"TypeError: window.require is not a function".
The actual ESM exports (Token, scheduler) that @html-next/vertical-collection
needs live in ember-raf-scheduler's addon/index.js. Adding a vite alias
redirects all ember-raf-scheduler imports to that file so vite correctly
pre-bundles it as proper ESM.
Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix lots of data page in docs app
fix: resolve ember-raf-scheduler to its ESM addon source for the lots-of-data demo
Feb 25, 2026
Contributor
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
/3-demos/lots-of-datacrashed with[object Object]because Vite's pre-bundler couldn't correctly handleember-raf-schedulerv0.3 (a v1 Ember addon).What broke
@html-next/vertical-collectionv5 imports{ Token, scheduler }fromember-raf-scheduler, but that package's rootindex.jsis a bare CJS ember-addon shim — no ESM exports. Vite wraps it with__commonJSand mistranslates the innerrequire('./package')call aswindow.require('./package'), which doesn't exist in the browser.Fix
Added a
resolve.aliasindocs-app/vite.config.jspointingember-raf-schedulerat itsaddon/index.js, which is proper ESM and exportsTokenandscheduleras expected. The path is resolved dynamically relative to where pnpm installs@html-next/vertical-collection, so it's not hardcoded.Result
The page now renders the live DBMon benchmark with FPS counter and a virtualized 200-row table updating at
requestAnimationFramespeed.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.