Description
Selecting a factory synth preset in the browser throws before the preset can be applied. loadSynthPreset calls CommonJS require("./uiStore") from the browser bundle, where require is not defined. Legacy preset identifiers such as piano, lead, strings, pad, and bass work because they bypass this action.
Tested commit: 2bebdd2cbaaef1092a06ff613c7868c9f3bd4b6c.
Steps to Reproduce
- Start the web app and create or select a piano-roll track.
- Open the synth preset browser.
- Select the factory preset Sub Bass (
factory-sub-bass), or call:
window.__store.getState().loadSynthPreset(trackId, "factory-sub-bass")
- Inspect the console and the track state.
Expected Behavior
The selected factory preset is applied to the track and updates its instrument/preset fields without a runtime error.
Actual Behavior
The action throws:
ReferenceError: require is not defined
No factory preset is applied.
Environment
- Browser: Google Chrome 147.0.7727.101 (headless Playwright)
- OS: Ubuntu 24.04.3 LTS
- Node version: 24.13.0
- Audio path: web / Tone.js
Screenshots / Logs
loadSynthPreset invokes require("./uiStore") despite the project being ESM/browser code. The factory preset ID is defined in synthPresets.ts.
Acceptance Criteria
Description
Selecting a factory synth preset in the browser throws before the preset can be applied.
loadSynthPresetcalls CommonJSrequire("./uiStore")from the browser bundle, whererequireis not defined. Legacy preset identifiers such aspiano,lead,strings,pad, andbasswork because they bypass this action.Tested commit:
2bebdd2cbaaef1092a06ff613c7868c9f3bd4b6c.Steps to Reproduce
factory-sub-bass), or call:Expected Behavior
The selected factory preset is applied to the track and updates its instrument/preset fields without a runtime error.
Actual Behavior
The action throws:
No factory preset is applied.
Environment
Screenshots / Logs
loadSynthPresetinvokesrequire("./uiStore")despite the project being ESM/browser code. The factory preset ID is defined insynthPresets.ts.Acceptance Criteria
factory-sub-bassfrom the preset browser applies it withoutReferenceError.loadSynthPreset(trackId, "factory-sub-bass")from the exposed store action updates the track deterministically.