Skip to content

node/global.ts doesn't polyfill during importing module #2068

Description

@hirochachacha

Describe the bug

Steps to Reproduce

main.ts

import "https://deno.land/std@0.132.0/node/global.ts";
import "./mod.ts";

mod.ts

console.log(Buffer);

then

$ deno run --allow-all main.ts

got

Check file:///xxx/main.ts
error: Uncaught ReferenceError: Buffer is not defined
console.log(Buffer);
            ^
    at file:///xxx/mod.ts:1:13

Expected behavior

no errors

Environment

  • OS: MacOS 12.3
  • deno version: 1.19.3
  • std version: 0.132.0

FWIW, this issue has been persisted since 7029144, std@0.110.0 works fine as far as I know.
Although I'm not sure where the root cause comes from. It could be a runtime or compiler issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions