René's URL Explorer Experiment


Title: Enviornment.ts toggling and correct usage of WebpackDevMiddlewareOptions EnvironmentVariables · Issue #1322 · aspnet/JavaScriptServices · GitHub

Open Graph Title: Enviornment.ts toggling and correct usage of WebpackDevMiddlewareOptions EnvironmentVariables · Issue #1322 · aspnet/JavaScriptServices

X Title: Enviornment.ts toggling and correct usage of WebpackDevMiddlewareOptions EnvironmentVariables · Issue #1322 · aspnet/JavaScriptServices

Description: I have added a parameter to my webpack commands so that I can swap out the Remote API endpoints. I am flipping between mocked data files and staging endpoints, and I wanted people on the team to be able to do that locally while developin...

Open Graph Description: I have added a parameter to my webpack commands so that I can swap out the Remote API endpoints. I am flipping between mocked data files and staging endpoints, and I wanted people on the team to be...

X Description: I have added a parameter to my webpack commands so that I can swap out the Remote API endpoints. I am flipping between mocked data files and staging endpoints, and I wanted people on the team to be...

Opengraph URL: https://github.com/aspnet/JavaScriptServices/issues/1322

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Enviornment.ts toggling and correct usage of WebpackDevMiddlewareOptions EnvironmentVariables","articleBody":"I have added a parameter to my webpack commands so that I can swap out the Remote API endpoints.  I am flipping between mocked data files and staging endpoints, and I wanted people on the team to be able to do that locally while developing.\r\nwebpack **--env.target=staging** --progress --color\r\nwebpack **--env.target=mocked** --progress --color\r\n\r\nIn webpack I do the hostreplacement (this all seems to be worknig just fine):\r\n```\r\n const environmentFiles = {\r\n        dev: \"./ClientApp/src/environments/environment.dev.ts\",\r\n        devMocked: \"./ClientApp/src/environments/environment.devMocked.ts\",\r\n        staging: \"./ClientApp/src/environments/environment.staging.ts\",\r\n        prod: \"./ClientApp/src/environments/environment.prod.ts\"\r\n      };\r\n    console.log(env.target)\r\n    const envFile = environmentFiles[env.target];\r\n\r\nnew AotPlugin({\r\n                tsConfigPath: './tsconfig.json',\r\n                entryModule: path.join(__dirname, 'ClientApp/src/app.module.browser#AppModule'),\r\n                exclude: ['./**/*.server.ts'],\r\n                \"hostReplacementPaths\": {\r\n                    \"./ClientApp/src/environments/environment\": `${envFile}`\r\n                  },\r\n                // Set flag to false to allow AOT\r\n\t            \"skipCodeGeneration\": true\r\n            })\r\n```\r\n\r\nMy issue is when I run VS Code [Development] Launch Web I get a NodeServices error of target is undefined.  So It does not like my env.target from the code sample above.\r\n\r\nI added the EnvironmentVariables but this does not work.   I am using this wrong?  I can comment out the whole UseWebpackDevMiddleware code block and let the code use the manual webpack build I created from the command line, but then I lose HMR.  Which I absolutely don't want to lose.  \r\n\r\n```\r\napp.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions\r\n                {\r\n                    HotModuleReplacement = true,\r\n                    EnvironmentVariables = new Dictionary\u003cstring, string\u003e()\r\n                    {\r\n                    { \"target\", \"staging\" }\r\n                    }\r\n                });\r\n```\r\n\r\nI still get the error, full error is below.\r\n\r\n```\r\nException has occurred: CLR/System.AggregateException\r\nAn exception of type 'System.AggregateException' occurred in System.Private.CoreLib.dll but was not handled in user code: 'One or more errors occurred.'\r\n Inner exceptions found, see $exception in variables window for more details.\r\n Innermost exception \t Microsoft.AspNetCore.NodeServices.HostingModels.NodeInvocationException : Cannot read property 'target' of undefined\r\nTypeError: Cannot read property 'target' of undefined\r\n    at module.exports (c:\\Users\\v-jormc\\Source\\Repos\\Xbox.Ambassadors\\Microsoft.Ambassadors\\Microsoft.Ambassadors.Web.Client\\webpack.config.js:19:22)\r\n    at createWebpackDevServer (c:\\Users\\v-jormc\\Source\\Repos\\Xbox.Ambassadors\\Microsoft.Ambassadors\\Microsoft.Ambassadors.Web.Client\\node_modules\\aspnet-webpack\\WebpackDevMiddleware.js:194:31)\r\n    at createWebpackDevServer (C:\\Users\\v-jormc\\AppData\\Local\\Temp\\104gtbeg.vbc:74:50)\r\n    at C:\\Users\\v-jormc\\AppData\\Local\\Temp\\2we2pffu.pst:114:19\r\n    at IncomingMessage.\u003canonymous\u003e (C:\\Users\\v-jormc\\AppData\\Local\\Temp\\2we2pffu.pst:133:38)\r\n    at emitNone (events.js:105:13)\r\n    at IncomingMessage.emit (events.js:207:7)\r\n    at endReadableNT (_stream_readable.js:1045:12)\r\n    at _combinedTickCallback (internal/process/next_tick.js:138:11)\r\n    at process._tickCallback (internal/process/next_tick.js:180:9)\r\n```\r\n\r\nUpdate:  Is EnviornmentVariables meant to do what is being talked about in this thread in regards to the EnvParameter?   Or are we still needing something else to achieve what I am trying to do?\r\nhttps://github.com/aspnet/JavaScriptServices/issues/816\r\n","author":{"url":"https://github.com/jrmcdona","@type":"Person","name":"jrmcdona"},"datePublished":"2017-10-06T14:12:46.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/1322/JavaScriptServices/issues/1322"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:141e2f85-867a-b445-aa99-129afd589810
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAE38:1AFAE0:7DE2B6:A194DA:6974FF65
html-safe-nonce637a7be423f1ea69267c1ca2e6f14bf3d16a66d36b8e55e0003044ef76833594
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRTM4OjFBRkFFMDo3REUyQjY6QTE5NERBOjY5NzRGRjY1IiwidmlzaXRvcl9pZCI6IjUzNzYwMTc0MTIzNTAzNDUwNjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac1fe5b48103401bcc98a2559a85a9c7918dd8b0560181b942040db727f5b7ac8d
hovercard-subject-tagissue:263460175
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/aspnet/JavaScriptServices/1322/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d9a3bffa96c3e479a960930de3bc87a54258b76a602e4041766d8113268f0cdb/aspnet/JavaScriptServices/issues/1322
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d9a3bffa96c3e479a960930de3bc87a54258b76a602e4041766d8113268f0cdb/aspnet/JavaScriptServices/issues/1322
og:image:altI have added a parameter to my webpack commands so that I can swap out the Remote API endpoints. I am flipping between mocked data files and staging endpoints, and I wanted people on the team to be...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejrmcdona
hostnamegithub.com
expected-hostnamegithub.com
None4a4bf5f4e28041a9d2e5c107d7d20b78b4294ba261cab243b28167c16a623a1f
turbo-cache-controlno-preview
go-importgithub.com/aspnet/JavaScriptServices git https://github.com/aspnet/JavaScriptServices.git
octolytics-dimension-user_id6476660
octolytics-dimension-user_loginaspnet
octolytics-dimension-repository_id45365298
octolytics-dimension-repository_nwoaspnet/JavaScriptServices
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id45365298
octolytics-dimension-repository_network_root_nwoaspnet/JavaScriptServices
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release488b30e96dfd057fbbe44c6665ccbc030b729dde
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/aspnet/JavaScriptServices/issues/1322#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Faspnet%2FJavaScriptServices%2Fissues%2F1322
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Faspnet%2FJavaScriptServices%2Fissues%2F1322
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=aspnet%2FJavaScriptServices
Reloadhttps://patch-diff.githubusercontent.com/aspnet/JavaScriptServices/issues/1322
Reloadhttps://patch-diff.githubusercontent.com/aspnet/JavaScriptServices/issues/1322
Reloadhttps://patch-diff.githubusercontent.com/aspnet/JavaScriptServices/issues/1322
aspnet https://patch-diff.githubusercontent.com/aspnet
JavaScriptServiceshttps://patch-diff.githubusercontent.com/aspnet/JavaScriptServices
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Faspnet%2FJavaScriptServices
Fork 517 https://patch-diff.githubusercontent.com/login?return_to=%2Faspnet%2FJavaScriptServices
Star 3k https://patch-diff.githubusercontent.com/login?return_to=%2Faspnet%2FJavaScriptServices
Code https://patch-diff.githubusercontent.com/aspnet/JavaScriptServices
Issues 0 https://patch-diff.githubusercontent.com/aspnet/JavaScriptServices/issues
Pull requests 0 https://patch-diff.githubusercontent.com/aspnet/JavaScriptServices/pulls
Projects 0 https://patch-diff.githubusercontent.com/aspnet/JavaScriptServices/projects
Wiki https://patch-diff.githubusercontent.com/aspnet/JavaScriptServices/wiki
Security 0 https://patch-diff.githubusercontent.com/aspnet/JavaScriptServices/security
Insights https://patch-diff.githubusercontent.com/aspnet/JavaScriptServices/pulse
Code https://patch-diff.githubusercontent.com/aspnet/JavaScriptServices
Issues https://patch-diff.githubusercontent.com/aspnet/JavaScriptServices/issues
Pull requests https://patch-diff.githubusercontent.com/aspnet/JavaScriptServices/pulls
Projects https://patch-diff.githubusercontent.com/aspnet/JavaScriptServices/projects
Wiki https://patch-diff.githubusercontent.com/aspnet/JavaScriptServices/wiki
Security https://patch-diff.githubusercontent.com/aspnet/JavaScriptServices/security
Insights https://patch-diff.githubusercontent.com/aspnet/JavaScriptServices/pulse
Enviornment.ts toggling and correct usage of WebpackDevMiddlewareOptions EnvironmentVariableshttps://patch-diff.githubusercontent.com/aspnet/JavaScriptServices/issues/1322#top
https://github.com/jrmcdona
https://github.com/jrmcdona
jrmcdonahttps://github.com/jrmcdona
on Oct 6, 2017https://github.com/aspnet/JavaScriptServices/issues/1322#issue-263460175
#816https://github.com/aspnet/JavaScriptServices/issues/816
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.