-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Expected Behavior
The package should build successfully in modern bundlers (esbuild, Vite, Angular 21) without module resolution errors.
All internal imports in the published build output should resolve correctly using valid relative paths.
Current Behavior
The build fails with the following error:
Could not resolve "src/exposure/exposure"
node_modules/@amplitude/experiment-node-server/dist/src/local/client.js:81:27
81 │ const exposure_1 = require("src/exposure/exposure");
The compiled file contains an invalid internal imports:
require("src/exposure/exposure");
require("src/exposure/exposure-filter");
require("src/exposure/exposure-service");
The issue appeared after upgrading build tooling to Angular 21 (esbuild-based).
Possible Solution
Fix the internal imports in the compiled output to use a valid relative path, for example:
require("../exposure/exposure");
This issue is exposed by stricter, spec-compliant bundlers and affects any esbuild-based setup.
Steps to Reproduce
- Create a project using Angular 21 (or any esbuild-based bundler)
- Install @amplitude/experiment-node-server
- Import the package (directly or transitively) in the project
- Run the build
The build fails during module resolution.
Environment
- JS Server SDK Version: latest at time of writing (also reproducible with previous versions)
- Installation Method: npm
- Browser and Version: N/A (build-time error)
gfazioli, hbiarge, chris-addison, matty-at-rdc, 4esnog and 2 more
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working