admin管理员组

文章数量:1345083

I was trying to setup fabricjs in my application. since application uses micro-frontends , I use @angular-architects/module-federation for custom builder. when I install fabricjs it breaks otherwise it works fine.After investigating I found the error is in federation.config.js. here is my federation.config.js.

const {
  withNativeFederation,
  shareAll,
} = require('@angular-architects/native-federation/config');
module.exports = withNativeFederation({
  name: 'Origin',
  shared: {
    ...shareAll({
      singleton: true,
      strictVersion: true,
      requiredVersion: 'auto',
    }),
  },

  skip: [
    'fabric',
    /^@fabric/,
    'rxjs/ajax',
    'rxjs/fetch',
    'rxjs/testing',
    'rxjs/webSocket',
    /^@expo/,
    /^expo/,
    /^react/,
    // Add further packages you don't need at runtime
    /^@nestjs/,
    'class-validator',
    'class-transformer',
    'redis',
    'nats',
    /^fastify/,
    'winston',
    'winston-daily-rotate-file',
    'mongoose',
    '@arena-pro/backend-support',
    '@arena-pro/inn-nats-jetstream',
    '@arena-pro/inn-logger',
    '@grpc/grpc-js',
    '@grpc/proto-loader',
  ],

  // Please read our FAQ about sharing libs:
  // 
});

here is the error

pnpm run start:frontend --verbose

> @arena-pro/[email protected] start:frontend /workspace
> nx run-many --target=serve --projects=tag:frontend --parallel --verbose

⠙ Creating project graph nodes with 7 plugins(node:28575) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)

 NX   Running target serve for project origin:

- origin

————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

> nx run origin:serve

 NX   Cannot read properties of null (reading 'default')
TypeError: Cannot read properties of null (reading 'default')
    at getDefaultEntry (/workspace/node_modules/.pnpm/@[email protected]/node_modules/@softarc/native-federation/src/lib/config/share-utils.js:181:26)
    at readConfiguredSecondaries (/workspace/node_modules/.pnpm/@[email protected]/node_modules/@softarc/native-federation/src/lib/config/share-utils.js:145:23)
    at getSecondaries (/workspace/node_modules/.pnpm/@[email protected]/node_modules/@softarc/native-federation/src/lib/config/share-utils.js:112:24)
    at Object.share (/workspace/node_modules/.pnpm/@[email protected]/node_modules/@softarc/native-federation/src/lib/config/share-utils.js:304:33)
    at shareAll (/workspace/node_modules/.pnpm/@[email protected]/node_modules/@softarc/native-federation/src/lib/config/share-utils.js:216:27)
    at Object.<anonymous> (/workspace/apps/frontend/origin/federation.config.js:8:8)
    at Module._compile (node:internal/modules/cjs/loader:1554:14)
    at Object..js (node:internal/modules/cjs/loader:1706:10)
    at Module.load (node:internal/modules/cjs/loader:1289:32)
    at Function._load (node:internal/modules/cjs/loader:1108:12)

————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 NX   Running target serve for project origin failed

Failed tasks:

- origin:serve

 ELIFECYCLE  Command failed with exit code 1.

I tried to follow this only thread on internet, but skip array didnot work. Thank you in advance. fabricjs works fine in normal angular project.

本文标签: angularNX Cannot read properties of null (reading 39default39)Stack Overflow