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
Hosting.targets uses undefined $(RepoRoot) + monorepo-relative paths → consumer frontend build never runs; app.js 302s to login #221
The shipped SimpleModule.Hosting.targets (Tailwind + Vite build integration) references an undefined $(RepoRoot) and monorepo-relative paths, so in a downstream consumer the integrated frontend build never runs — and a follow-on MapStaticAssets interaction causes the app's bootstrap script to 302-redirect to the login page (blank app).
$(RepoRoot) is not defined anywhere in a sm new project scaffold, and $(RepoRoot)packages/... / $(RepoRoot)modules are monorepo-only layouts (a consumer has src/modules and gets the theme from the @simplemodule/theme-default npm package). Result:
Even with node_modules present at the repo root, the build prints warning : node_modules not found. Tailwind CSS will not be compiled. and ... Frontend JavaScript will not be compiled.
The integrated Tailwind/Vite build is skipped, so the consumer must run npm run build manually.
If npm run build runs afterdotnet build, the MapStaticAssets manifest (generated during dotnet build) does not contain wwwroot/js/app.js. At runtime the <script src="/js/app.js"> request is not a static-asset endpoint, falls through to the FallbackPolicy = RequireAuthenticatedUser, and 302-redirects to /Identity/Account/Login → Failed to load module script: Expected a JavaScript module but the server responded with text/html → blank page.
Repro
sm new project X &&cd X && npm install
dotnet build # manifest captured here, before app.js exists
npm run build # now wwwroot/js/app.js exists, but not in the manifest
dotnet run --project src/X.Host
# browse the app -> /js/app.js 302 -> login, React never hydrates
Suggested fix
Define $(RepoRoot) in the scaffold (e.g. Directory.Build.props) and make the Tailwind/Vite targets consumer-aware (theme from the npm package, src/modules, the repo-root node_modules), or ship a consumer profile that drives the frontend build via npm run build and documents the required ordering.
Consider letting MapStaticAssets().AllowAnonymous() also serve the host wwwroot so a missing/late asset 404s anonymously instead of redirecting to login.
Activity
fix(cli): resolve scaffold build/runtime bugs (#218, #219, #221, #225, …
antosubash commentedon Jun 3, 2026
Fixed in #231 (merged db8be0e). Verified the fix is present on
main.