Questions tagged [angular-package-format]
15 questions
5
votes
1 answer
Importing anything from @angular/cdk in Cypress tests breaks the build with Angular 13
Since updating to Angular 13, my Cypress tests that are importing from @angular/cdk (mostly for using test harnesses on Angular material) fail to compile with the following error:
Error: Webpack Compilation…

fusio
- 3,595
- 6
- 33
- 47
3
votes
0 answers
Creating an Uber Module of Modules in the same library?
I have a library that packages up several components and their corresponding modules.
I can import those modules by themselves in an external application and they work fine.
I tried to package them all up in an Uber module within the same library…

Ole
- 41,793
- 59
- 191
- 359
2
votes
1 answer
How to import angular 13 library packaged SASS?
With Angular 13 and the ng-packagr when we publish SASS mixins with a library we need to add the library to exports in package.json and also declare an assets block in ng-package.json.
These are the…

Ole
- 41,793
- 59
- 191
- 359
2
votes
1 answer
Initialization of component properties in Angular 12?
I'm converting a component library over to Angular 12, and the linting is giving me errors on annotated properties like this one that will be initialized by the annotation:
@ViewChild(MatSort, { static: false }) sort: MatSort;
The error…

Ole
- 41,793
- 59
- 191
- 359
2
votes
1 answer
Angular node_modules/@types Error while (Serve Build Issue)
After npm install, when I try to 'ng build' the following error occurs:
ERROR in node_modules/@types/node/globals.d.ts(713,19): error TS2304: Cannot find name 'bigint'.
node_modules/@types/node/ts3.6/base.d.ts(13,21): error TS2727: Cannot find lib…

Dhairya Bhavsar
- 319
- 4
- 13
2
votes
1 answer
SyntaxError: Unexpected token { when running ts-node in Angular Package Format project
I'm trying to run a typescript file with ts-node. Getting a weird error:
import { tes } from "./tes";
^
SyntaxError: Unexpected token {
at Module._compile (internal/modules/cjs/loader.js:720:23)
If I copy the project ts files into…

Ole
- 41,793
- 59
- 191
- 359
1
vote
0 answers
Creating a moduleNameMapper for ts-jest import of ts-gaussian?
I've created a demo for this issue here.
The fail branch has a test that tries to import ts-gaussian like this:
import { Gaussian } from 'ts-gaussian';
const distribution = new Gaussian(0, 1);
test("gaussian", ()=>{
expect(true).toBeTruthy()
}…

Ole
- 41,793
- 59
- 191
- 359
1
vote
2 answers
Upgrading library projects to Angular 12?
I'm trying to run this on library projects / projects that have a workspace:
ng update @angular/core @angular/cli @angular/material
It worked on one project, however for the rest I always get:
Cannot locate bin for temporary package:…

Ole
- 41,793
- 59
- 191
- 359
1
vote
1 answer
MatIconModule no longer compiles in libraries
I'm trying to use the MatIconModule in a Angular Package Format library and when I introduce the MatIconModule it fails to compile. To see for yourself clone the MVCE repository:
git clone git@github.com:fireflysemantics/maticonmoduleerror.git
cd…

Ole
- 41,793
- 59
- 191
- 359
1
vote
1 answer
Angular Compile Fails When Importing Library Function into Web Worker?
I have a web worker that looks like this. This used to work fine in previous Angular versions:
///
import { ParseResult } from "papaparse";
import { readCSV } from '@fireflysemantics/csv';
addEventListener('message',…

Ole
- 41,793
- 59
- 191
- 359
0
votes
1 answer
Non null assertion operator not working in new Angular Library project?
I created a new Angular library project with this code.
/**
* Extract the path from the URL.
*
* @param url The URL to extract the path from
*/
export function urlPath(url: string): string {
return url!.match(/.*?(?=[?;#]|$)/)[0];
}
And…

Ole
- 41,793
- 59
- 191
- 359
0
votes
1 answer
Angular: Include third party dependency in custom angular library
I am trying to create a library as npm package using ng generate library ts-utils command
This library use of a dependency called memoizee, where we include the library and its respective @types in the peerDependencies section of the library.
NOTE:…

Herman Andres Figueroa
- 513
- 3
- 9
- 26
0
votes
1 answer
Running Typedoc on Project includes files from node_modules?
I have this project setup with typedoc and the npm script (npm run d) used to work:
"d": "typedoc --out doc --exclude **/*.spec.ts ./projects/fs-is/src/lib"
I upgraded the project to Angular 12 (It uses the Angular Package Format) and now when…

Ole
- 41,793
- 59
- 191
- 359
0
votes
1 answer
Jest test failing when using Array.prototype.includes with Typescript?
I started using Array.prototype.includes in this project:
https://github.com/fireflysemantics/validator
It is packaged using the Angular Package Format and the source is in this…

Ole
- 41,793
- 59
- 191
- 359
-1
votes
1 answer
Calling Auth.signUp from an Angular Package Format Library produces type error?
Most of the aws-amplify auth functions can be call from Angular libraries. For example Auth.signout() works fine.
However I tried to put the following implementation in a library service:
/**
* @param firstName The first name
* @param…

Ole
- 41,793
- 59
- 191
- 359