Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: parent deno.json not discovered if subfolder contains package.json #27852

Open
marvinhagemeister opened this issue Jan 28, 2025 · 1 comment

Comments

@marvinhagemeister
Copy link
Contributor

Ran into this whilst hacking on an adapter for nitro.

Steps to reproduce

  1. Create deno.json with these contents:
{
  "unstable": ["node-globals"],
}
  1. Create a file sub/foo.ts with these contents:
console.log(`Buffer: ${typeof Buffer}`);
  1. Create an empty file sub/package.json
  2. Run deno run sub/foo.ts -> Buffer is undefined

Full directory structure:

/
  deno.json
  sub/
    package.json
    foo.ts

Version: Deno 2.1.7+aeac5a6

@dsherret
Copy link
Member

dsherret commented Jan 28, 2025

That's by design. You need to add the sub folder as a workspace member otherwise the package.json is considered a workspace of its own:

{
  "workspace": ["./sub"],
  "unstable": ["node-globals"],
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants