redwoodjs / redwood

The App Framework for Startups
https://redwoodjs.com
MIT License
17.31k stars 994 forks source link

[Bug]: yarn rw build does not work when the app is stored on a file path with a space character. #11464

Open adendiamond opened 1 month ago

adendiamond commented 1 month ago

What's not working?

Same as title. When I move my app to the root C:/, it builds fine.

How do we reproduce the bug?

Below is my terminal I/O for creating a RedwoodJs app and trying to build it with a space character in the file path:

C:\Users\adend\OneDrive - The University of Melbourne\a>yarn create redwood-app my-redwood-project
yarn create v1.22.22
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...

success Installed "create-redwood-app@8.0.0" with binaries:
      - create-redwood-app
------------------------------------------------------------------
                🌲⚑️ Welcome to RedwoodJS! ⚑️🌲
------------------------------------------------------------------
βœ” Compatibility checks passed
βœ” Creating your Redwood app in my-redwood-project based on command line argument
√ Select your preferred language · TypeScript
√ Do you want to initialize a git repo? · no / Yes
βœ” Project files created

Thanks for trying out Redwood!

 ⚑️ Get up and running fast with this Quick Start guide: https://redwoodjs.com/quick-start

Fire it up! πŸš€

 > cd my-redwood-project
 > yarn install
 > yarn rw dev

Telemetry error
TT [OTLPExporterError]
    at IncomingMessage.<anonymous> (file:///C:/Users/adend/AppData/Local/Yarn/Data/global/node_modules/create-redwood-app/dist/create-redwood-app.js:147:72228)
    at IncomingMessage.emit (node:events:531:35)
    at endReadableNT (node:internal/streams/readable:1696:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  data: 'error code: 526',
  code: 526
}
Done in 9.91s.

C:\Users\adend\OneDrive - The University of Melbourne\a>cd my-redwood-project

C:\Users\adend\OneDrive - The University of Melbourne\a\my-redwood-project>yarn install
➀ YN0000: · Yarn 4.4.0
➀ YN0000: β”Œ Resolution step
➀ YN0000: β”” Completed in 0s 423ms
➀ YN0000: β”Œ Post-resolution validation
➀ YN0086: β”‚ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
➀ YN0000: β”” Completed
➀ YN0000: β”Œ Fetch step
➀ YN0000: β”” Completed in 4s 869ms
➀ YN0000: β”Œ Link step
➀ YN0007: β”‚ core-js@npm:3.38.0 must be built because it never has been before or the last one failed
➀ YN0007: β”‚ esbuild@npm:0.23.0 must be built because it never has been before or the last one failed
➀ YN0007: β”‚ msw@npm:1.3.3 [6af00] must be built because it never has been before or the last one failed
➀ YN0007: β”‚ @prisma/client@npm:5.18.0 [02b51] must be built because it never has been before or the last one failed
➀ YN0007: β”‚ @swc/core@npm:1.7.11 [2e6cb] must be built because it never has been before or the last one failed
➀ YN0007: β”‚ esbuild@npm:0.21.5 must be built because it never has been before or the last one failed
➀ YN0007: β”‚ core-js-pure@npm:3.38.1 must be built because it never has been before or the last one failed
➀ YN0007: β”‚ @prisma/engines@npm:5.18.0 must be built because it never has been before or the last one failed
➀ YN0007: β”‚ prisma@npm:5.18.0 must be built because it never has been before or the last one failed
➀ YN0000: β”” Completed in 3m 5s
➀ YN0000: · Done with warnings in 3m 10s

C:\Users\adend\OneDrive - The University of Melbourne\a\my-redwood-project>yarn rw build
βœ” Generating Prisma Client...
βœ” Verifying graphql schema...
βœ” Building API...
βœ– Command failed with exit code 1: node C:\Users\adend\OneDrive - The University of Melbourne\a\my-redwood-project\node_modules\@redwoodjs\vite\bins\rw-vite-build.mjs --webDir="C:\Users\adend\OneDrive - The        
University of Melbourne\a\my-redwood-project\web" --verbose=false
node:internal/modules/cjs/loader:1228
throw err;
^

Error: Cannot find module 'C:\Users\adend\OneDrive'
at Module._resolveFilename (node:internal/modules/cjs/loader:1225:15)
at Module._load (node:internal/modules/cjs/loader:1051:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

Node.js v20.17.0
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Error: Command failed with exit code 1: node C:\Users\adend\OneDrive - The University of Melbourne\a\my-redwood-project\node_modules\@redwoodjs\vite\bins\rw-vite-build.mjs --webDir="C:\Users\adend\OneDrive - The University of Melbourne\a\my-redwood-project\web" --verbose=false
node:internal/modules/cjs/loader:1228
  throw err;
  ^

Error: Cannot find module 'C:\Users\adend\OneDrive'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1225:15)
    at Module._load (node:internal/modules/cjs/loader:1051:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
    at node:internal/main/run_main_module:28:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v20.17.0
    at makeError (C:\Users\adend\OneDrive - The University of Melbourne\a\my-redwood-project\node_modules\execa\lib\error.js:60:11)
    at handlePromise (C:\Users\adend\OneDrive - The University of Melbourne\a\my-redwood-project\node_modules\execa\index.js:118:26)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async _Task.task [as taskFn] (C:\Users\adend\OneDrive - The University of Melbourne\a\my-redwood-project\node_modules\@redwoodjs\cli\dist\commands\buildHandler.js:112:9)
    at async _Task.run (C:\Users\adend\OneDrive - The University of Melbourne\a\my-redwood-project\node_modules\listr2\dist\index.cjs:2049:11)

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Need help?
 - Not sure about something or need advice? Reach out on our Forum (​https://community.redwoodjs.com/​)
 - Think you've found a bug? Open an issue on our GitHub (​https://github.com/redwoodjs/redwood​)
 - Here's your unique error reference to quote: 'e310bb32-cc4d-410d-b2aa-9bc0d9b8512f'
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

And here is the I/O for yarn rw build, building the same app from C:/:

C:\my-redwood-project>yarn rw build
βœ” Generating Prisma Client...
βœ” Verifying graphql schema...
βœ” Building API...
βœ” Building Web...

Creating 200.html...
Starting prerendering...
You have not marked any routes to "prerender" in your Routes (​file://C:\my-redwood-project\web\src\Routes.tsx​).

What's your environment? (If it applies)

System:
    OS: Windows 10 10.0.19045
  Binaries:
    Node: 20.17.0 - ~\AppData\Local\Temp\xfs-1cc9b24b\node.CMD
    Yarn: 4.4.0 - ~\AppData\Local\Temp\xfs-1cc9b24b\yarn.CMD  
  Databases:
    SQLite: 3.44.2 - C:\msys64\ucrt64\bin\sqlite3.EXE
  Browsers:
    Edge: Chromium (127.0.2651.74)
  npmPackages:
    @redwoodjs/auth-dbauth-setup: 8.0.0 => 8.0.0
    @redwoodjs/core: 8.0.0 => 8.0.0
    @redwoodjs/project-config: 8.0.0 => 8.0.0
  redwood.toml:
    [web]
      title = "Redwood App"
      port = 8910
      apiUrl = "/.redwood/functions" # You can customize graphql and dbauth urls individually too: see https://redwoodjs.com/docs/app-configuration-redwood-toml#api-paths
      includeEnvironmentVariables = [
        # Add any ENV vars that should be available to the web side to this array
        # See https://redwoodjs.com/docs/environment-variables#web
      ]
    [api]
      port = 8911
    [browser]
      open = false
    [notifications]
      versionUpdates = ["latest"]

Are you interested in working on this?

standuprey commented 1 month ago

I got the same error message (telemetry error) with the same node version (but mac), except build worked

➀ YN0000: β”Œ Resolution step
➀ YN0000: β”” Completed in 0s 394ms
➀ YN0000: β”Œ Fetch step
➀ YN0000: β”” Completed
➀ YN0000: β”Œ Link step
➀ YN0000: β”‚ ESM support for PnP uses the experimental loader API and is therefore experimental
➀ YN0000: β”” Completed
➀ YN0000: Done with warnings in 0s 426ms

------------------------------------------------------------------
                🌲⚑️ Welcome to RedwoodJS! ⚑️🌲
------------------------------------------------------------------
βœ” Compatibility checks passed
βœ” Creating your Redwood app in qetting based on command line argument
βœ” Select your preferred language Β· TypeScript
βœ” Do you want to initialize a git repo? Β· no / Yes
βœ” Enter a commit message Β· Initial commit
βœ” Do you want to run yarn install? Β· no / Yes
βœ” Project files created
βœ” Installed node modules
βœ” Generated types
βœ” Initialized a git repo with commit message "Initial commit"

Thanks for trying out Redwood!

 ⚑️ Get up and running fast with this Quick Start guide: https://redwoodjs.com/quick-start

Fire it up! πŸš€

 > cd qetting
 > yarn rw dev

Telemetry error
TT [OTLPExporterError]
    at IncomingMessage.<anonymous> (file:///Users/stan/.yarn/berry/cache/create-redwood-app-npm-8.0.0-263acec24b-8.zip/node_modules/create-redwood-app/dist/create-redwood-app.js:147:72228)
    at IncomingMessage.emit (node:events:531:35)
    at endReadableNT (node:internal/streams/readable:1696:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  data: 'error code: 526',
  code: 526
}
➜  Code cd qetting
➜  qetting git:(master) yarn install
➀ YN0000: · Yarn 4.4.0
➀ YN0000: β”Œ Resolution step
➀ YN0000: β”” Completed
➀ YN0000: β”Œ Post-resolution validation
➀ YN0086: β”‚ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
➀ YN0000: β”” Completed
➀ YN0000: β”Œ Fetch step
➀ YN0000: β”” Completed in 0s 385ms
➀ YN0000: β”Œ Link step
➀ YN0000: β”” Completed in 0s 243ms
➀ YN0000: · Done with warnings in 0s 900ms
➜  qetting git:(master) rw info

  System:
    OS: macOS 14.3.1
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.17.0 - /private/var/folders/g7/0v2mwcd50dv822c6142lth1h0000gp/T/xfs-d839381d/node
    Yarn: 4.4.0 - /private/var/folders/g7/0v2mwcd50dv822c6142lth1h0000gp/T/xfs-d839381d/yarn
  Databases:
    SQLite: 3.43.2 - /usr/bin/sqlite3
  Browsers:
    Chrome: 128.0.6613.120
    Safari: 17.3.1
  npmPackages:
    @redwoodjs/core: 8.0.0 => 8.0.0
    @redwoodjs/project-config: 8.0.0 => 8.0.0
  redwood.toml:
    [web]
      title = "Redwood App"
      port = 8910
      apiUrl = "/.redwood/functions" # You can customize graphql and dbauth urls individually too: see https://redwoodjs.com/docs/app-configuration-redwood-toml#api-paths
      includeEnvironmentVariables = [
        # Add any ENV vars that should be available to the web side to this array
        # See https://redwoodjs.com/docs/environment-variables#web
      ]
    [api]
      port = 8911
    [browser]
      open = true
    [notifications]
      versionUpdates = ["latest"]
➜  qetting git:(master) yarn rw build
βœ” Generating Prisma Client...
βœ” Verifying graphql schema...
βœ” Building API...
βœ” Building Web...

Creating 200.html...
Starting prerendering...
You have not marked any routes to "prerender" in your Routes.
Tobbe commented 1 month ago

Thanks for the issue report @adendiamond and @standuprey

I think there are two separate things going on here.

  1. The path with spaces bug
  2. The telemetry issue

We're aware of the telemetry issue and @Josh-Walker-GM is in charge of sorting that out. We just wanted to focus on getting RW v8 out first πŸ™‚

I'll ask @callingmedic911 to take a look at the path issue