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

CLI crash on loading of website #6607

Open
jonathan-wondereur opened this issue May 15, 2024 · 2 comments
Open

CLI crash on loading of website #6607

jonathan-wondereur opened this issue May 15, 2024 · 2 comments
Labels
type: bug code to address defects in shipped code

Comments

@jonathan-wondereur
Copy link

jonathan-wondereur commented May 15, 2024

Describe the bug

When loading the site after using the netlify dev command I get a crash.

Task Terminated with exit code 1
URIError: URI malformed
    at decodeURIComponent (<anonymous>)
    at rewriter (file:///usr/local/lib/node_modules/netlify-cli/dist/utils/rules-proxy.js:87:19)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at onRequest (file:///usr/local/lib/node_modules/netlify-cli/dist/utils/proxy.js:559:19)

  System:
    OS: macOS 14.4.1
    CPU: (8) arm64 Apple M1
  Binaries:
    Node: 20.11.1 - /usr/local/bin/node
    npm: 10.5.0 - /usr/local/bin/npm
  Browsers:
    Safari: 17.4.1
  npmGlobalPackages:
    netlify-cli: 17.23.5

Steps to reproduce

  1. Run netlify dev
  2. Load website in browser

Configuration

# TOML lint: https://www.toml-lint.com/
[build]
  base = ""
  publish = "dist"
  command = "npm i --prefix functions && npm run build && cp ./headers/_stagingHeaders ./dist/_headers && cp -r ./public ./dist"
  functions = "functions"

[context.production]
  command = "npm i --prefix functions && npm run build && cp ./headers/_prodHeaders ./dist/_headers && cp -r ./public ./dist"

[build.environment]
  GO_VERSION = "1.22.0"

[functions]
  node_bundler = "esbuild"

[[redirects]]
  from = "/*"
  to = "/"
  status = 200

Environment

System:
OS: macOS 14.4.1
CPU: (8) arm64 Apple M1
Memory: 90.88 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.11.1 - /usr/local/bin/node
npm: 10.5.0 - /usr/local/bin/npm
npmGlobalPackages:
netlify-cli: 17.23.5

@jonathan-wondereur jonathan-wondereur added the type: bug code to address defects in shipped code label May 15, 2024
@jonathan-wondereur
Copy link
Author

Removing the redirect fixes the issues, but of course breaks my deploy.

[[redirects]]
  from = "/*"
  to = "/"
  status = 200

@bgmort
Copy link

bgmort commented Aug 23, 2024

I am experiencing this same issue. I also tried commenting out my redirects, and the app runs again just like @jonathan-wondereur found.

Adding this to netlify.toml also seems to work around the problem:

[dev]
  autoLaunch = false

so maybe there's some kind of race condition here.

Here's my cli error output:

URIError: URI malformed
    at decodeURIComponent (<anonymous>)
    at rewriter (file:///Users/xxxxx/.node/lib/node_modules/netlify-cli/dist/utils/rules-proxy.js:87:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async onRequest (file:///Users/xxxxx/.node/lib/node_modules/netlify-cli/dist/utils/proxy.js:594:19)

  System:
    OS: macOS 14.4
    CPU: (8) x64 Apple M1
  Binaries:
    Node: 20.17.0 - /usr/local/bin/node
    Yarn: 1.22.17 - /opt/homebrew/bin/yarn
    npm: 10.8.2 - /usr/local/bin/npm
  Browsers:
    Chrome: 127.0.6533.120
    Safari: 17.4
  npmGlobalPackages:
    netlify-cli: 17.34.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

2 participants