Presently, I'm engrossed in a project involving Angular 9 and ASP Core 3.
You can find the website at:
Nevertheless, encountering an error when trying to access this URL:
http://mag-testcpl.astromap.ir/assets/vendors/global/toastr.css
The culprit seems to be this HTML snippet:
<head>
<meta charset="utf-8">
... (omitted for brevity) ...
<link id="toaster" href="./assets/vendors/global/toastr.css" rel="stylesheet">
... (omitted for brevity) ...
Upon entering the above URL in the browser, it fails to display any content. However, tweaking the URL to include '/app' like so:
http://mag-testcpl.astromap.ir/app/assets/vendors/global/toastr.css
Add /app to the URL.
This adjustment allows the file to be displayed without issues.
I attempted building the project with the following command: ng build --prod --base-href /app
What steps should I take to resolve this issue?
.... (omitted for brevity) .... </div></questionbody> <exquestionbody> <div class="question"> <p>i have a project in angular 9 and asp core 3 .</p> <p>this is addres of site :<a href="http://mag-testcpl.astromap.ir/" rel="nofollow noreferrer">http://mag-testcpl.astromap.ir/</a></p> <p>and it show me this error: </p> <p><code>http://mag-testcpl.astromap.ir/assets/vendors/global/toastr.css
and this is in my html :
<head> <meta charset="utf-8"> <title>Astronomy Mag | Admin panel</title> <base href="/app"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" type="image/x-icon" href="./assets/media/logos/favicon.png"> <link id="mainStyle" href="./assets/css/demo1/style.bundle.main.css" rel="stylesheet"> <link id="ltrStyle" href="./assets/css/demo1/style.bundle.css" rel="stylesheet"> <link id="rtlStyle" href="./assets/css/demo1/style.bundle.rtl.css" rel="stylesheet"> <link id="toaster" href="./assets/vendors/global/toastr.css" rel="stylesheet"> <style> </style>
when i enter this url in brwoser
it not show me any things but when i enter this url in by thishttp://mag-testcpl.astromap.ir/assets/vendors/global/toastr.css
http://mag-testcpl.astromap.ir/app/assets/vendors/global/toastr.css
add /app to url
it's worked and show me file .
i build the project with this command
ng build --prod --base-href /app
how can i solve this problem ?????
"architect": { "build": { "builder": "@angular-devkit/build-angular:browser", "options": { "outputPath": "dist/avastar", "index": "src/index.html", "main": "src/main.ts", "polyfills": "src/polyfills.ts", "tsConfig": "src/tsconfig.app.json", "assets": [ "src/favicon.png", "src/assets" ], "styles": [ "src/styles.scss", "./node_modules/quill/assets/snow.styl", "./node_modules/quill/assets/core.styl", "./node_modules/quill/assets/bubble.styl" ], "scripts": [ "src/assets/vendors/global/vendors.bundle.js", "src/assets/js/demo1/scripts.bundle.js" ], "stylePreprocessorOptions": { "includePaths": [ "src", "src/stylings/", "src/stylings/base/", "src/stylings/kt-customs/" ] }, "es5BrowserSupport": true }, "configurations": { "production": { "fileReplacements": [ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.prod.ts" } ], "optimization": true, "outputHashing": "all", "sourceMap": false, "extractCss": true, "namedChunks": false, "aot": false, "extractLicenses": true, "vendorChunk": false, "buildOptimizer": false, "budgets": [ { "type": "initial", "maximumWarning": "5mb", "maximumError": "10mb" } ] } } }, "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { "browserTarget": "avastar:build" }, "configurations": { "production": { "browserTarget": "avastar:build:production" } } }, "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", "options": { "browserTarget": "avastar:build" } }, "test": { "builder": "@angular-devkit/build-angular:karma", "options": { "main": "src/test.ts", "polyfills": "src/polyfills.ts", "tsConfig": "src/tsconfig.spec.json", "karmaConfig": "src/karma.conf.js", "styles": [ "src/styles.scss" ], "scripts": [], "assets": [ "src/assets" ] } }, "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { "tsConfig": [ "src/tsconfig.app.json", "src/tsconfig.spec.json" ], "exclude": [ "**/node_modules/**" ] } } }