-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Deno is not able to resolve npm workspace dependency types #26306
Comments
i have both deno.json and package.json at the root of the project: My root deno.json: {
"compilerOptions": {
"lib": [
"deno.window",
"dom",
"esnext"
],
"jsx": "react-jsx",
"jsxImportSource": "react"
},
"fmt": {
"exclude": [
"*.yaml",
"deploy/**"
]
},
"unstable": ["kv"],
"exclude": [
"node_modules",
"README.md",
"apps/**/build",
"docs/**",
".github"
],
"hooks": {
"pre-commit": "deno fmt --check && deno lint"
},
"workspace": [
"./apps/project",
"./packages/ui",
"./packages/collab"
]
} My root {
"name": "project",
"private": true,
"scripts": {
"build": "PWD=$PWD/apps/project remix vite:build",
"dev": "PWD=$PWD/apps/project remix vite:dev",
"lint": "deno lint . --fix",
"fmt": "deno fmt .",
"ui": "PWD=$PWD/packages/ui deno npm:shadcn@latest --"
},
"optionalDependencies": {
"@rollup/rollup-linux-arm64-musl": "^4.22.5",
"@rollup/rollup-linux-x64-gnu": "4.22.4"
},
"workspaces": [
"./apps/*",
"./packages/*"
]
} |
May be related to #26305 , since |
I think it's related to my issue here: https://discord.com/channels/684898665143206084/1296203871827398696 I'm trying out Deno 2 in a full npm monorepo (so only However the VS Code LSP is working fine. 🤔 |
Same here:
Interesting part is that
I also have |
Version: Deno 2.0.0
tldr: Deno seems to be having problems resolving npm workspace dependency types with packages having only
package.json
; Maybe because the exports uses*
?My current structure is:
project/apps/project
-> Remix app with a package.json. Runtime runs vite w/ deno, and the imports are resolved just fine. Points toproject/packages/ui
via"@project/ui": "^1.0.0"
in package.json.project/packages/ui
-> React library exporting some components. Includes apackage.json
, but i've noticed that adding a deno.json kind of solves the type resolving (i'd have a package.json AND a deno.json just to be able to use deno check etc.; i've already done this for another package).But also ends up introducing another problem: exports using a wildcard (
*
) seems to make all exports in deno.json stop being detected. I've tested in different packages here, and everything works until you have any export using a wildcard. Inproject/packages/ui/package.json
, i have an exports map like that:This does not work in deno.json, so i have to either put an export for all files, or create a barrel file, that i'd really prefer not to.
Output of
deno check .
at root:Hovering the import, the Deno LSP shows me:
The text was updated successfully, but these errors were encountered: