Next.js:错误 - ./node_modules/etag/index.js:22:0 找不到模块:无法解析“fs”为空

时间:2020-12-29 23:50:14

标签: node.js typescript webpack next.js fs

export class SpringApiError extends ApiError {
    readonly timestamp: string;
    readonly path: string;
    constructor(dto: ServerErrorDto) {
        super(dto.status, dto.message);
        this.timestamp = dto.timestamp;
        this.name = dto.error;
        this.path = dto.path;
    }

    toString() {
        return `
            ${this.stack} | ${this.name} | ${this.message}
        `
    }

}

interface ServerErrorDto {
    timestamp?: string,
    status: number,
    error: string
    message: string
    path?: string
}

出于某种原因,仅仅扩展 ApiError 会给我一个来自 etag 模块的错误。 任何想法为什么? 这正常吗?

我可能只是在找课……我很高兴扩展 Error

0 个答案:

没有答案