Skip to content

Using Buffer no longer works after upgrading to Deno v2 #27368

Open
@bombillazo

Description

Version: Deno 2+

Hello, after upgrading to Deno v2, our use of Buffer no longer works. We get the following error:

error: TS2576 [ERROR]: Property 'from' does not exist on type 'Buffer'. Did you mean to access the static member 'Buffer.from' instead?
    Buffer.from(data, 'base64').toString('utf-8')

We are importing with

import { Buffer } from 'buffer';
{
  "imports": {
    "buffer": "node:buffer",
  }
}

If also tried https://deno.land/std/io/buffer.ts and @std/io/buffer

Metadata

Assignees

No one assigned

    Labels

    compilerelated to the `deno compile` featureneeds infoneeds further information to be properly triagednode compat

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions