Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable ivy throw ERROR in Invariant violated: No format-path or format for 3th party library #32188

Closed
elvisbegovic opened this issue Aug 19, 2019 · 0 comments

Comments

@elvisbegovic
Copy link
Contributor

commented Aug 19, 2019

馃悶 bug report

Affected Package

The issue is caused by package @angular/compiler-cli/ngcc/src/main.ts

Is this a regression?

Yes it was working before this commit

Description

In ngcc.config.js I config a 3th party lib like:

module.exports = {
  packages: {
    'my-lib': {
      entryPoints: {
        '.': {
          override: {
            module:undefined,
            main: 'index.js',
          }
        }
      }
    }
  }
};

And this commit seems not allow module:undefined anymore

馃敩 Minimal Reproduction

If you use any 3th party lib listed here that require module: undefined in a ngcc.config.js file.

馃敟 Exception or Error


ERROR in Invariant violated: No format-path or format for C:/.../node_modules/my-lib : module (formatPath: undefined | format: esm5)

馃實 Your Environment

Angular Version:

Angular CLI: 8.3.0-rc.0
Node: 12.8.1
OS: win32 x64
Angular: 9.0.0-next.2
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker

Package Version

@angular-devkit/architect 0.803.0-rc.0
@angular-devkit/build-angular 0.803.0-rc.0
@angular-devkit/build-optimizer 0.803.0-rc.0
@angular-devkit/build-webpack 0.803.0-rc.0
@angular-devkit/core 8.3.0-rc.0
@angular-devkit/schematics 8.3.0-rc.0
@angular/cdk 8.1.3
@angular/cli 8.3.0-rc.0
@angular/material 8.1.3
@angular/pwa 0.803.0-rc.0
@ngtools/webpack 8.3.0-rc.0
@schematics/angular 8.3.0-rc.0
@schematics/update 0.803.0-rc.0
rxjs 6.5.2
typescript 3.5.3
webpack 4.39.2

Anything else relevant?
/cc @gkalpak

@ngbot ngbot bot added this to the needsTriage milestone Aug 19, 2019

elvisbegovic added a commit to elvisbegovic/angular that referenced this issue Aug 20, 2019
fix(ngcc): ignore format properties that exist but are undefined
Previously, `ngcc` assumed that if a format property was defined in
`package.json` it would point to a valid format-path (i.e. a file that
is an entry-point for a specific format). This is generally the case,
except if a format property is set to a non-string value (such as
`package.json`) - either directly in the `package.json` (which is unusual)
or in ngcc.config.js (which is a valid usecase, when one wants a
format property to be ignored by `ngcc`).

For example, the following config file would cause `ngcc` to throw:

```
module.exports = {
  packages: {
    'test-package': {
      entryPoints: {
        '.': {
          override: {
            fesm2015: undefined,
          },
        },
      },
    },
  },
};
```

This commit fixes it by ensuring that only format properties whose value
is a string are considered by `ngcc`.

For reference, this regression was introduced in angular#32052.

Fixes angular#32188
ngdevelop-tech added a commit to ngdevelop-tech/angular that referenced this issue Aug 27, 2019
fix(ngcc): ignore format properties that exist but are undefined (ang鈥
鈥lar#32205)

Previously, `ngcc` assumed that if a format property was defined in
`package.json` it would point to a valid format-path (i.e. a file that
is an entry-point for a specific format). This is generally the case,
except if a format property is set to a non-string value (such as
`package.json`) - either directly in the `package.json` (which is unusual)
or in ngcc.config.js (which is a valid usecase, when one wants a
format property to be ignored by `ngcc`).

For example, the following config file would cause `ngcc` to throw:

```
module.exports = {
  packages: {
    'test-package': {
      entryPoints: {
        '.': {
          override: {
            fesm2015: undefined,
          },
        },
      },
    },
  },
};
```

This commit fixes it by ensuring that only format properties whose value
is a string are considered by `ngcc`.

For reference, this regression was introduced in angular#32052.

Fixes angular#32188

PR Close angular#32205
sabeersulaiman added a commit to sabeersulaiman/angular that referenced this issue Sep 6, 2019
fix(ngcc): ignore format properties that exist but are undefined (ang鈥
鈥lar#32205)

Previously, `ngcc` assumed that if a format property was defined in
`package.json` it would point to a valid format-path (i.e. a file that
is an entry-point for a specific format). This is generally the case,
except if a format property is set to a non-string value (such as
`package.json`) - either directly in the `package.json` (which is unusual)
or in ngcc.config.js (which is a valid usecase, when one wants a
format property to be ignored by `ngcc`).

For example, the following config file would cause `ngcc` to throw:

```
module.exports = {
  packages: {
    'test-package': {
      entryPoints: {
        '.': {
          override: {
            fesm2015: undefined,
          },
        },
      },
    },
  },
};
```

This commit fixes it by ensuring that only format properties whose value
is a string are considered by `ngcc`.

For reference, this regression was introduced in angular#32052.

Fixes angular#32188

PR Close angular#32205
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can鈥檛 perform that action at this time.