Angular Library Compile Time Error "Invariant violated: No format-path or format"
Asked Answered
L

1

9

I have an Angular 11 project that is trying to integrate SpreadJS Designer, but is failing during the ngcc step Compiling @grapecity/spread-sheets-designer-angular : esm2015 as esm2015 with the exception:

Error on worker #3: Error: Invariant violated: No format-path or format for /path/to/my/project/node_modules/@grapecity/spread-sheets-designer-angular : main (formatPath: bundles/grapecity-spread-sheets-designer-angular.umd.js | format: undefined)

How do I further diagnose and fix this problem?

Here is the output of npx ng version for my project:

Angular CLI: 11.0.2
Node: 14.15.1
OS: linux x64

Angular: 11.0.2
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1100.2
@angular-devkit/build-angular   0.1100.2
@angular-devkit/core            11.0.2
@angular-devkit/schematics      11.0.2
@angular/cdk                    11.0.1
@angular/material               11.0.1
@schematics/angular             11.0.2
@schematics/update              0.1100.2
rxjs                            6.5.3
typescript                      4.0.5

Then rm -rf node_modules && npm install; npm ls | grep grapecity gives this output:

├─┬ @grapecity/[email protected]
│ └── @grapecity/[email protected] deduped
├── @grapecity/[email protected]
├─┬ @grapecity/[email protected]
│ ├── @grapecity/[email protected] deduped
├─┬ @grapecity/[email protected]
│ └── @grapecity/[email protected] deduped
├─┬ @grapecity/[email protected]
│ └── @grapecity/[email protected] deduped
├── @grapecity/[email protected]
├─┬ @grapecity/[email protected]
├── @grapecity/[email protected]
├─┬ @grapecity/[email protected]
│ └── @grapecity/[email protected] deduped
├─┬ @grapecity/[email protected]
│ ├── @grapecity/[email protected] deduped
│ └── @grapecity/[email protected] deduped
├─┬ @grapecity/[email protected]
│ └── @grapecity/[email protected] deduped
├─┬ @grapecity/[email protected]
│ └── @grapecity/[email protected]
├─┬ @grapecity/[email protected]
│ └── @grapecity/[email protected] deduped
├─┬ @grapecity/[email protected]
│ └── @grapecity/[email protected] deduped
├─┬ @grapecity/[email protected]
│ └── @grapecity/[email protected] deduped
Lemmueu answered 30/11, 2020 at 21:44 Comment(12)
do you have any code source example? if hard to config and test your problemBaba
Hello, I work for SpreadJS's technical support team, I am sorry I am unable to replicate what you are observing. Please share additional steps or information for us to test this on our end. I also wanted to note that it would also be helpful if you have sample project you can share with our team to look deeper into. Thank you, Mackenzie Albitz GrapeCity SupportDdt
Can you also provide your exact angular version, also i know that it might sound banal but had you tried to reinstal your node modules. I tried to install @grapecity/spread-sheets-designer-angular from v 14.0.0 up to 14.0.3 and faced no issues in compling the code.Tricostate
@GrapeCityTeam Hi Mackenzie, I have an open ticket in your system related to this. I'm just reaching out on SO to cast a wider net. As I said on that ticket, I'd be happy to give someone on your team access to the private github repository to investigate further.Lemmueu
@ХристиянХристов I've updated the question with details about environment and package versions.Lemmueu
@Baba yea I know it's something specific about my project configuration, and I can compile an example provided by grapecity. The bounty is in hopes of me getting a better understanding of what could give rise to this particular error message in hopes that it leads back to what exactly about my project configuration is amiss. Unfortunately it's in a private repository.Lemmueu
Nope the issue is not with you, i tried re-installing the library again on Linux ,also on Mac os and ended up wtih the error that you have. I guess that GrapeCityTeam don't follow the angular package format and that leads to the error.Tricostate
Had you tried to downgrade your angular version?Tricostate
Let us continue this discussion in chat.Tricostate
Please add a stackblitz.com showing the error :)Chabot
I'm having the same issue. Did you find a solution?Synaeresis
@BossOz I think it was resolved by an update to the @grapecity/* packages to 14.0.5 for meLemmueu
O
0

I had some problems with SpreadJS + Designer following their poor examples .. anyway. what helped me was:

import { DomSanitizer } from '@angular/platform-browser'

.
.
.

title: 'Tabela customizável',
designer: null,
props: {
 styleInfo: **this.sanitizer.bypassSecurityTrustStyle**('width: 100%; height: calc(100vh - 300px)'),
 config: this.spreadMenuConfig,
},
Oversleep answered 21/12, 2020 at 19:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.