denoland / fresh

The next-gen web framework.
https://fresh.deno.dev
MIT License
12.19k stars 623 forks source link

Renaming the root directory breaks the fresh project (tailwindcss) #2619

Open byvide opened 1 month ago

byvide commented 1 month ago

PROBLEM

PS C:\...\NEW-NAME> deno task start
Task start deno run -A --watch=static/,routes/ dev.ts
Watcher Process started.
The manifest has been generated for 5 routes and 1 islands.
error: Uncaught (in promise) Error: Cannot find module '@alloc/quick-lru'
Require stack:
- C:\...\NEW-NAME\node_modules\.deno\tailwindcss@3.4.1\node_modules\tailwindcss\lib\lib\setupTrackingContext.js
- C:\...\NEW-NAME\node_modules\.deno\tailwindcss@3.4.1\node_modules\tailwindcss\lib\plugin.js
- C:\...\NEW-NAME\node_modules\.deno\tailwindcss@3.4.1\node_modules\tailwindcss\lib\index.js
- C:\...\NEW-NAME\node_modules\.deno\tailwindcss@3.4.1\node_modules\tailwindcss\lib\index.js
    at Function.Module._resolveFilename (node:module:608:15)
    at Function.Module._load (node:module:486:27)
    at Module.require (node:module:674:19)
    at require (node:module:785:16)
    at Object.<anonymous> (file:///C:/.../NEW-NAME/node_modules/.deno/tailwindcss@3.4.1/node_modules/tailwindcss/lib/lib/setupTrackingContext.js:17:58)
    at Object.<anonymous> (file:///C:/.../NEW-NAME/node_modules/.deno/tailwindcss@3.4.1/node_modules/tailwindcss/lib/lib/setupTrackingContext.js:168:4)
    at Module._compile (node:module:730:34)
    at Object.Module._extensions..js (node:module:744:10)
    at Module.load (node:module:655:32)
    at Object.Module._extensions..js (node:module:744:10)
    at Object.Module._extensions..js (node:module:744:10)
    at Module.load (node:module:655:32)
    at Object.Module._extensions..js (node:module:744:10)
    at Module.load (node:module:655:32)
    at Function.Module._load (node:module:523:12)
Watcher Process failed. Restarting on file change...
    at Object.Module._extensions..js (node:module:744:10)
    at Module.load (node:module:655:32)
    at Function.Module._load (node:module:523:12)
    at Object.Module._extensions..js (node:module:744:10)
    at Module.load (node:module:655:32)
    at Function.Module._load (node:module:523:12)
    at Object.Module._extensions..js (node:module:744:10)
    at Module.load (node:module:655:32)
    at Function.Module._load (node:module:523:12)
    at Object.Module._extensions..js (node:module:744:10)
    at Module.load (node:module:655:32)
    at Function.Module._load (node:module:523:12)
    at Object.Module._extensions..js (node:module:744:10)
    at Module.load (node:module:655:32)
    at Function.Module._load (node:module:523:12)
    at Object.Module._extensions..js (node:module:744:10)
    at Module.load (node:module:655:32)
    at Object.Module._extensions..js (node:module:744:10)
    at Object.Module._extensions..js (node:module:744:10)
    at Module.load (node:module:655:32)
    at Function.Module._load (node:module:523:12)
Watcher Process failed. Restarting on file change...
  // untouched deno.json
  "imports": {
    "$fresh/": "https://deno.land/x/fresh@1.6.8/",
    "preact": "https://esm.sh/preact@10.19.6",
    "preact/": "https://esm.sh/preact@10.19.6/",
    "@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/"
  },

STEPS TO REPRODUCE

  1. create new fresh project 1.1. deno run -A -r https://fresh.deno.dev 1.2. select tailwindcss (and VS Code)
  2. run deno task start 2.1 abort
  3. rename the root directory (in this case ORIGINAL-NAME => NEW-NAME)
  4. run deno task start
mx237 commented 2 weeks ago

I didn't rename the project, but got the same error after updating from an old version. I deleted the node_modules folder and ran it again to fetch the npm modules from a clean state. Then the issue was resolved.