devinD
Denoβ€’13mo agoβ€’
2 replies
devin

fresh + workspace

i have bootstrapped a fresh project inside a deno workspace. when installing at the workspace root, i get the following error:
$ deno install --allow-scripts=npm:@bufbuild/buf@1.47.2
error: Relative import path "@preact/signals-core" not prefixed with / or ./ or ../ and not in import map from "https://esm.sh/v135/@preact/signals@1.2.2/X-ZS8q/denonext/signals.mjs"
    at https://esm.sh/v135/@preact/signals@1.2.2/X-ZS8q/denonext/signals.mjs:2:196

what does this mean?

here's the root deno.json (i've moved lock, compilerOptions and nodeModulesDir from the fresh project):
{
  "workspace": ["./web"],
  "lock": false,
  "compilerOptions": {
    "jsx": "react-jsx",
    "jsxImportSource": "preact"
  },
  "nodeModulesDir": "auto"
}

and here's the web's deno.json:
{
  "tasks": {
    "check": "deno fmt --check && deno lint && deno check **/*.ts && deno check **/*.tsx",
    "cli": "echo \"import '\\$fresh/src/dev/cli.ts'\" | deno run --unstable -A -",
    "manifest": "deno task cli manifest $(pwd)",
    "start": "deno run -A --watch=static/,routes/ dev.ts",
    "build": "deno run -A dev.ts build",
    "preview": "deno run -A main.ts",
    "update": "deno run -A -r https://fresh.deno.dev/update ."
  },
  "lint": {
    "rules": {
      "tags": [
        "fresh",
        "recommended"
      ]
    }
  },
  "exclude": [
    "**/_fresh/*"
  ],
  "imports": {
    "$fresh/": "https://deno.land/x/fresh@1.7.3/",
    "preact": "https://esm.sh/preact@10.22.0",
    "preact/": "https://esm.sh/preact@10.22.0/",
    "@preact/signals": "https://esm.sh/*@preact/signals@1.2.2",
    "@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.5.1",
    "tailwindcss": "npm:tailwindcss@3.4.1",
    "tailwindcss/": "npm:/tailwindcss@3.4.1/",
    "tailwindcss/plugin": "npm:/tailwindcss@3.4.1/plugin.js",
    "$std/": "https://deno.land/std@0.216.0/"
  }
}
Was this page helpful?