You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
vite: package imports are stubbed as missing optional dependencies #11564
@nativescript/vite 8.0.17 with Octane 0.10.2 fails during iOS dev boot with Cannot find module '#octane/dist/signal-actions/graph' (also #octane/dist/signal-actions/bindings), despite valid package.json imports-map entries. The same guard is present on current main (1fe745085).
createOptionalDependencyStubEsbuildPlugin treats # specifiers as bare dependencies and probes them with a project-scoped createRequire(...).resolve(id, { paths: [dirname(importer)] }). The paths option does not change the package imports scope, so valid dependency-internal imports fail the probe and become throwing ns-optional-dep-stub modules.
Minimal reproduction: create node_modules/fixture/package.json with imports: { "#internal": "./internal.js" }, export value = 42 from internal.js, and import it from the fixture entry. Bundle through the actual optional-dependency plugin with esbuild and evaluate the output: it throws Cannot find module '#internal'.
Letting # specifiers fall through to esbuild resolves them using the importer's package scope. A regression test can also verify a genuinely absent optional dependency still throws inside try/catch and preserves the fallback. No simulator is needed.
Activity