I am trying to use this library in angular application. It was working fine for 5.0.0-Rc7. After updating to stable release 5.0.0, I am encountering errors while serving and building the application. Below is the error that is produced while serving the application.

I think the reference for types of node is missing and the declaration file for style-options is also missing.
ill make a hot fix, weird
ill make a hot fix, weird
Any update on this?
I am also facing issues after migrating Docx from version 4 to 5 in angular application
I am facing same issue after upgrading to stable release 5.0.0
I am also facing the same issue after upgrading from 5.0.0-Rc7 version to release 5.0.0 .
Eagerly waiting for the fix as soon as possible.
I have made a fix here:
https://github.com/dolanmiu/docx/pull/490
This correctly exports the style-options, which should fix the problem you're having
It also adds @types/node as a dependency, so it will include all that Buffer good stuff included, which should fix that other issue
Will be released in 5.0.1
Still not working - file is not provided.
Its related to: https://github.com/s-panferov/awesome-typescript-loader/issues/432
Please add:
/**
* @ignore
*/
export const WORKAROUND = "";
to style-options.ts like in other files which contains only declarations or switch to ts-loader.
@dolanmiu The solution by @webcarrot works for the style-options.ts.
For the missing type for the Buffer from node, it is still not working. I checked the distribution build and
/// <reference types="node" />
is missing from the declaration files which is present in previous builds.
packer.d.ts
Previous releases:
/// <reference types="node" />
import { File } from "../../file";
export declare class Packer {
static toBuffer(file: File, prettify?: boolean): Promise<Buffer>;
static toBase64String(file: File, prettify?: boolean): Promise<string>;
static toBlob(file: File, prettify?: boolean): Promise<Blob>;
private static readonly compiler;
}
Current release:
import { File } from "../../file";
export declare class Packer {
static toBuffer(file: File, prettify?: boolean): Promise<Buffer>;
static toBase64String(file: File, prettify?: boolean): Promise<string>;
static toBlob(file: File, prettify?: boolean): Promise<Blob>;
private static readonly compiler;
}
@dolanmiu The solution by @webcarrot works for the
style-options.ts.
For the missing type for theBufferfromnode, it is still not working. I checked the distribution build and
/// <reference types="node" />
is missing from the declaration files which is present in previous builds.packer.d.ts
Previous releases:
/// <reference types="node" />
import { File } from "../../file";
export declare class Packer {
static toBuffer(file: File, prettify?: boolean): Promise<Buffer>;
static toBase64String(file: File, prettify?: boolean): Promise<string>;
static toBlob(file: File, prettify?: boolean): Promise<Blob>;
private static readonly compiler;
}Current release:
import { File } from "../../file";
export declare class Packer {
static toBuffer(file: File, prettify?: boolean): Promise<Buffer>;
static toBase64String(file: File, prettify?: boolean): Promise<string>;
static toBlob(file: File, prettify?: boolean): Promise<Blob>;
private static readonly compiler;
}
Interesting... Can you tell me which version worked? So I can investigate?
@c-bibek-shrestha
Edit: 5.0.0-Rc7 am I correct?
Here is the diff between master and 5.0.0-rc7:
https://github.com/dolanmiu/docx/compare/5.0.0-rc7...master?diff=split
here is the diff between master and 5.0.0-rc6:
https://github.com/dolanmiu/docx/compare/5.0.0-rc6...master?diff=split
I can't see anything suspecious
@dolanmiu The solution by @webcarrot works for the
style-options.ts.
For the missing type for theBufferfromnode, it is still not working. I checked the distribution build and
/// <reference types="node" />
is missing from the declaration files which is present in previous builds.packer.d.ts
Previous releases:
/// <reference types="node" />
import { File } from "../../file";
export declare class Packer {
static toBuffer(file: File, prettify?: boolean): Promise<Buffer>;
static toBase64String(file: File, prettify?: boolean): Promise<string>;
static toBlob(file: File, prettify?: boolean): Promise<Blob>;
private static readonly compiler;
}
Current release:
import { File } from "../../file";
export declare class Packer {
static toBuffer(file: File, prettify?: boolean): Promise<Buffer>;
static toBase64String(file: File, prettify?: boolean): Promise<string>;
static toBlob(file: File, prettify?: boolean): Promise<Blob>;
private static readonly compiler;
}Interesting... Can you tell me which version worked? So I can investigate?
@c-bibek-shrestha
Edit: 5.0.0-Rc7 am I correct?
Yes. I was talking about the *.d.ts file that is generated after you build it. Now it works after including types:["node"] in tsconfig.app.json. Kudos for the library.
Most helpful comment
ill make a hot fix, weird