Webpack Module Federation Error ScriptExternalLoadError: Loading script failed - webpack-5

NOTE: I tried accessing this directly in the browser https://localhost:5007/accom-web/dist/js/assets/browser-bundle/remoteEntryTest.js and I'm served the remoteEntryTest.js file.
This is my webconfig in host.
This is webconfig of remote application.
Optimization config for remote application is below.
optimization: {
runtimeChunk: false,
emitOnErrors: true,
splitChunks: {
minSize: 256000,
minChunks: 1,
maxAsyncRequests: 10,
automaticNameDelimiter: '-',
cacheGroups: {
chunks: 'initial',
.....
},
},
.....
}
I looked at the GitHub issues regarding this too but didn't help much.
https://github.com/module-federation/module-federation-examples/issues/307
https://github.com/module-federation/module-federation-examples/issues/1273
https://github.com/module-federation/module-federation-examples/issues/692
Any suggestions on this how to fix it?

I had a similar issue with specifying shared dependencies on a remote. I ended up having to disable splitChucks after reviewing your Github references. I'm sure you tried that as well but this got my remote working again recently.
optimization: {
splitChunks: false,
},

Related

vcpkg does not use registry defined in `vcpkg-configuration.json`

I'm trying to use a modified version of imgui through vcpkg.
I've created a git repository to be used for the registry (https://github.com/altschuler/vcpkg-custom-ports), and copied over the imgui port configuration, and made the changes I needed (following guides like this and this).
However, vcpkg seems to ignore the entry for the custom repo in vcpkg-configuration.json, it simply doesn't load anything from it (I know because I tried changing the repository url to something that doesn't exist). If I set the default-repository to my custom one it does load stuff, but then all the packages I want from the builtin registry obviously fail to install.
Note: the reason I need a custom port for imgui is that I need to compile some definitions (basically just do target_compile_definitions in its CMakeLists). If you know of an easier way to do that I'm all ears.
vcpkg-configuration.json:
{
"registries": [
{
"kind": "git",
"baseline": "e3b33f3a548f20ba06b2959aa3701bd50ece0638",
"repository": "https://github.com/altschuler/vcpkg-custom-ports.git",
"packages": ["imgui"]
}
]
}
vcpkg.json:
{
"name": "tester",
"version-string": "0.1.0",
"dependencies": [
"lager",
"sdl2",
{
"name": "imgui",
"features": ["docking-experimental", "sdl2-binding", "opengl3-binding"]
},
"immer",
"cereal",
"rxcpp",
"range-v3",
"glew",
"boost"
]
}
Try setting an environment variable
VCPKG_FEATURE_FLAGS=manifests,binarycaching,registries
AFAIK, some features are not enabled by default. Seems that manifests are automatically enabled, so vcpkg.json gets picked up, but perhaps "registries" are not enabled by default. (Disregard "binarycaching", if you don't use it).
This is what is working for me.

Why is this configuration for ESLint in Visual Studio 2017 not working?

I am currently wondering, why ESLint is not working in my project in Visual Studio 2017. There is the file ".eslintrc" in the project-root:
{
"extends": "defaults/configurations/eslint",
"env": {
"browser": true
},
"globals": {
"xhr": true
},
"rules": {
"eqeqeq": [ "error", "always", { "null": "ignore" } ]
}
}
If I remove the line with "eqeqeq", everything is working fine. But as soon as I add this line, no errors will be displayed at all.
Question 1: Is there any way to see an error-message about the issue ESLint obviously has?
Question 2 as a fallback: What is the issue with this line?
Thanks to btmills I took a dive into the sources and found the version: VS 2017 uses ESLint 2.0.0 (released 2016-02-12).
The correct configuration is:
"eqeqeq": [ 2, "allow-null" ]
Documentation is available here:
Getting started
Rules
The links from the error-list in VS 2017 lead to the current documentation, where you can find many features that do not work in version 2.0.0.

Kestrel port settings under VS2017 are ignored

I have an issue with starting Kestrel server from VS2017. In VS2015 in launchSettings.json I was able to set the port like this:
"Kestrel": {
"launchUrl": "http://localhost:5010/api",
"environmentVariables": {
"ASPNETCORE_URLS": "http://localhost:5010"
}
Now this setting is ignored by kestrel. If I change the name of the setting to: "ASPNETCORE_SERVER.URLS" I'm getting the warning about the setting being deprecated, which suggests that the launchSettings.json file is still being processed.
I also tried other options of setting the port - setting environment variable (ASPNETCORE_URLS) still works, but using dotnet run --server.urls http://0.0.0.0:5010 doesn't.
On VS2017 something like this works for me
"profiles": {
"Kestrel": {
"commandName": "Project",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:2287"
}
}
Running the app on port 2287

Turning off "Language Service Disabled" error message in VS2017

We are getting the following "Error" message in our MVC web application in Visual studio 2017 Enterprise.
The language service is disabled for project 'C:\Work\Blackhawk
Platform\Platform-DEV-Branch\BlackhawkViewer\BlackhawkViewer.csproj'
because it included a large number of .js files. Consider excluding
files using the 'exclude' section of a 'tsconfig.json' file.
I have tried turning off the Language service in the options but this does not turn the message off:
This is a rather large web application. Is there a way to turn this message off without disabling any files in the tsconfig.json file as it suggests?
To solve this issue do the following:
Create file in root directory of your project and call it tsconfig.json
Add this:
{
"compilerOptions": {
"allowJs": true,
"noEmit": true,
"module": "system",
"noImplicitAny": true,
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": true
},
"include": [
"scripts"
],
"exclude": [
],
"typeAcquisition": {
"enable": true
}
}
Please have a look at the below two links for tsconfig.json explanation, because you may still need to change it according to your setup. This is the only way that worked for me. I hope that will help.
https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
https://developercommunity.visualstudio.com/content/problem/8148/javascript-intellisense-not-working.html
This helped me. You can have a try.
Go to Tools -> Options -> Text Editor -> JavaScript/TypeScript -> Language Service -> General
and uncheck the box: "Enable the new JavaScript language service.
I have found a solution for this problem.
I reset my userData using:
devenv.exe /resetuserdata
Since doing this the JavaScript settings seem to have persisted and I no longer get the language service error above.
TAKE NOTE: This will reset all your user data and customisations.
In My case I just disable TypeScript support on Visual Studio:
Tools > Extensions and Updates > TypeScript for Microsoft Visual Studio > Disable
After that, just restart Visual Studio, and you are good to go.
Hope this will help,
I had the same problem after migrating Ionic 1 project from VS2015 to VS2017, first I executed git clean -fxd as sugested above and added this content into tsconfig.json in my ionic project.
{
"compilerOptions": {
"noImplicitAny": false,
"noEmitOnError": true,
"removeComments": false,
"sourceMap": true,
"target": "es5"
},
"exclude": [
"node_modules",
"www",
"bower_components"
]
}
I solved this problem with following solution:
When you have a JavaScript file that is included in the project.csproj file but isn't in the project folder, this error occurred.
For example I have a .csproj file like below:
<ItemGroup>
<Content Include="Scripts\Test.js" />
</ItemGroup>
The Test.js is included in the .csproj file, but it isn't in the Scripts folder:
Delete the <Content Include="Scripts\Test.js" /> line from the .csproj file and rebuild your project
Solution that worked for me:
Go to C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE>.
Open command prompt as admin in current folder
Ran devenv /Setup
Ran devenv /ResetSkipPkgs
For me is helping the next solution. I've create a tsconfig.json file in root of the my project with "disableSizeLimit": "true" option.
So, my tsconfig.json file is:
{
"compilerOptions": {
"disableSizeLimit": "true"
},
"exclude": []
}
If none of suggested methods worked, try:
npm install -g typescript#latest
and then
Install the latest version of TypeScript for Visual Studio on Get TypeScript.

Browserstack-runner tests are timing out with ember-qunit tests

I have an ember-cli project and all the tests are written using ember-qunit. I am using browserstack-runner to run the tests on Browserstack.
browserstack-runner provides the plugin for qunit which I am using. Below is my browserstack.json
{
"username": "USERNAME",
"key": "SECRETKEY",
"test_framework" : "qunit",
"test_path": ["tests/index.html"],
"timeout": "120",
"browsers": [
{
"browser": "chrome",
"browser_version": "latest",
"os": "Windows",
"os_version": "7",
"browserstack.debug": true
}
]
}
Tests are running correctly on browserstack. the only problem is, even after all the tests are run(passed) there is no activity and I am getting timeout error after specified value(120s).
I am not able to understand why it's happening. I guess it has something to do with plugin which is written specifically for qunit and not ember-qunit, which is a wrapper arount qunit.
Has anyone tried integrating browserstack with ember-cli project then please guide me.