Comments (5)
Any progress on this? This is happening for me with my dependencies.
I did some debugging, and it looks like the following is causing me issues.
My webpack stats do not have modules within each of the chunks. Instead each of my modules have chunks within them.
See copied log of stats
param from getExternalModules
function:
{
"errors": [],
"warnings": [],
"hash": "",
"builtAt": 1626391702947,
"publicPath": "",
"outputPath": "",
"entrypoints": {},
"namedChunkGroups": {},
"chunks": [
{
"id": "src/app/common/core/jwt-authorizer",
"rendered": true,
"initial": true,
"entry": true,
"size": 7825,
"names": [
"src/app/common/core/jwt-authorizer"
],
"files": [
"src/app/common/core/jwt-authorizer.js"
],
"hash": "cf21867fdbf405864441",
"siblings": [],
"parents": [],
"children": [],
"childrenByOrder": {}
},
...
],
"modules": [
{
"id": "aws-sdk",
"identifier": "external \"aws-sdk\"",
"name": "external \"aws-sdk\"",
"index": 7,
"index2": 5,
"size": 42,
"built": true,
"optional": false,
"prefetched": false,
"chunks": [
"src/app/controllers/location"
],
"issuer": "",
"issuerId": "",
"issuerName": "",
"issuerPath": [
{
"id": "",
"identifier": "",
"name": "",
"profile": {
"factory": 17,
"building": 323
}
},
{
"id": "",
"identifier": "",
"name": "",
"profile": {
"factory": 56,
"building": 279,
"dependencies": 277
}
}
],
"profile": {
"factory": 1,
"building": 0
},
"failed": false,
"errors": 0,
"warnings": 0,
"assets": [],
"providedExports": null,
"optimizationBailout": [],
"depth": 2
},
{
"id": "crypto",
"identifier": "external \"crypto\"",
"name": "external \"crypto\"",
"index": 4,
"index2": 2,
"size": 42,
"built": true,
"optional": false,
"prefetched": false,
"chunks": [
"src/app/common/core/jwt-authorizer",
"src/app/controllers/location"
],
"issuer": "",
"issuerId": "",
"issuerName": "",
"issuerPath": [
{
"id": "",
"identifier": "",
"name": "",
"profile": {
"factory": 73,
"building": 321,
"dependencies": 7
}
},
{
"id": "",
"identifier": "",
"name": "",
"profile": {
"factory": 9,
"building": 397
}
}
],
"profile": {
"factory": 0,
"building": 0
},
"failed": false,
"errors": 0,
"warnings": 0,
"assets": [],
"providedExports": null,
"optimizationBailout": [],
"depth": 2
},
...
],
"filteredModules": 0,
"logging": {
"webpack.buildChunkGraph.visitModules": {
"entries": [],
"filteredEntries": 2,
"debug": false
}
}
}
Changing getExternalModules(stats: any)
to
if (!stats.chunks) {
return [];
}
const externals = new Set();
for (const module of stats.modules) {
if (this.isExternalModule(module) && module.chunks) {
for (const chunkId of module.chunks) {
if (stats.chunks.find((chunk) => chunk.id === chunkId)) {
externals.add({
origin: module.issuer,
external: this.getExternalModuleName(module),
});
}
}
}
}
return Array.from(externals);
seems to properly add the dependencies to the generated package.json, subsequently allowing the builder to install them into the dist folder for deployment.
from nx-plugins.
i am investigating into this. Will find some free time this week to debug, thanks for the repo i can reproduce it now
from nx-plugins.
I've ran into this in the past (on older versions) and your triage is spot on, though the root cause may be different. My gut feeling is that it's coming from webpack's packaging, beyond that right now I'm not sure, I'll defer to Wick for now :)
from nx-plugins.
did #89 solve this issue? I'm seeing a valid package.json now, but the dependencies are not making it into the artifacts.
from nx-plugins.
It worked for me.
Note: I also have "externalDependencies": "all"
set in my angular.json
file (Under project-name.architect.build.options
) which I believe is the option to install and package the external dependencies.
from nx-plugins.
Related Issues (20)
- [BUG] Cannot create new api HOT 1
- [BUG] Cannot find module '@nrwl/workspace/src/utilities/run-webpack' HOT 1
- [BUG] Schematic "init" cannot resolve the factory. HOT 3
- [BUG] nx-serverless: Property 'port' does not match the schema. '7777' should be a 'number'. HOT 1
- [BUG] When using npm as packager, pacakgelist is not properly computed resulting in "*" for all package versions HOT 2
- [FEAT] Webpack stats.json support HOT 4
- [BUG] NX 13 and Webpack5 Support HOT 10
- Configuration error at 'useDotenv': should be equal to constant HOT 2
- [BUG] After creating monorepo blank workspace not able to create api HOT 3
- [FEAT] Nx-Serverless | option to exclude ALL dependencies from build HOT 1
- Cannot destructure property 'name' of 'node' as it is undefined. - @flowaccount/scully-plugin-angular-delay
- Support newer Serverless framework
- [BUG] Not able to run or build the freshly scaffolded project HOT 3
- [FEAT] Build functions individually HOT 9
- [BUG] Zip file resolution error when deploying a single artifact HOT 18
- Allow for a serverless.ts file HOT 8
- [BUG] Cannot Include Json Schema in serverless.yml HOT 6
- [BUG] Runtime.ImportModuleError in every Lambda function after deploying new project HOT 2
- [BUG] Missing compat.ts for sls executor HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nx-plugins.