Preact-cli: Generating firebase config doesn't work anymore

Created on 1 Mar 2018  ยท  4Comments  ยท  Source: preactjs/preact-cli

Do you want to request a feature or report a bug?
bug

What is the current behaviour?

$ preact serve --server config                                                                                                                                 
TypeError: Path must be a string. Received undefined

If the current behaviour is a bug, please provide the steps to reproduce.

$ npm i -g preact-cli
$ preact create default my-project
$ cd my-project
$ preact serve --server config                                                                                                                                 
TypeError: Path must be a string. Received undefined

What is the expected behaviour?
That's the output I get with preact-cli v2.1.1

$ preact serve --server config
{
  "rewrites": [
    {
      "source": "**",
      "destination": "/index.html"
    }
  ],
  "headers": [
    {
      "source": "**",
      "headers": [
        {
          "key": "Cache-Control",
          "value": "public, max-age=3600, no-cache"
        },
        {
          "key": "Access-Control-Max-Age",
          "value": "600"
        }
      ]
    },
    {
      "source": "/sw.js",
      "headers": [
        {
          "key": "Cache-Control",
          "value": "private, no-cache"
        }
      ]
    },
    {
      "source": "**/*.chunk.*.js",
      "headers": [
        {
          "key": "Cache-Control",
          "value": "public, max-age=31536000"
        }
      ]
    }
  ],
  "public": "build"
}

Please mention other relevant information.

  • Node version: v8.9.3
  • npm version: 5.6.0
  • Operating system: mac OS High Sierra
  • CLI version: 2.2.1

Most helpful comment

adding a --dest option allows it to succeed. Somehow the default has been dropped, maybe?

$ preact serve --server config --dest firebase.json

All 4 comments

Experiencing the same issue:

C:\ws\preact-book-example>node --version
v6.11.3

C:\ws\preact-book-example>npm --version
5.7.1

C:\ws\preact-book-example>ver

Microsoft Windows [Version 10.0.16299.309]

C:\ws\preact-book-example>preact --version
         โ–„โ–„
     โ–„โ–„โ–“โ–“โ–“โ–“โ–“โ–“โ–„โ–„
  โ–„โ–ˆโ–€โ–€โ–ˆโ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–€โ–€โ–ˆโ–„โ–„
โ–โ–“โ–Œโ–โ–“โ–“โ–“โ–’โ–„ โ–€โ–„โ–„โ–“โ–“โ–“โ–Œโ–โ–“โ–Œ
โ–โ–“โ–“โ–„โ–€โ–“โ–€ โ–„โ–“โ–“โ–„โ–„โ–€โ–“โ–“ โ–“โ–“โ–Œ
โ–โ–“โ–“โ–“โ–Œ โ–’โ–“โ–Œ  โ–โ–“โ–“  โ–“โ–“โ–“โ–Œ preact-cli 2.2.1
โ–โ–“โ–“ โ–’โ–“โ–„โ–„โ–€โ–“โ–“โ–€ โ–„โ–“โ–“ โ–“โ–“โ–Œ
โ–โ–“โ–Œโ–โ–“โ–“โ–“โ–€โ–€โ–„โ–„โ–€โ–€โ–“โ–“โ–“โ–Œโ–โ–“โ–Œ
  โ–€โ–ˆโ–„โ–„โ–’โ–“โ–“โ–“โ–“โ–“โ–“โ–’โ–„โ–„โ–’โ–€
      โ–€โ–“โ–“โ–“โ–“โ–“โ–“โ–€โ–€
         โ–€โ–€
For help with a specific command, enter:
  preact help [command]

Commands:
  create [template] [dest]  Create a new application.
  build [src] [dest]        Create a production build in build/
  watch [src]               Start a development live-reload server.
  serve [dir]               Start an HTTP2 static fileserver.
  list                      List all official templates

Options:
  -h, --help  Show help                                                [boolean]

Not enough non-option arguments: got 0, need at least 1

C:\ws\preact-book-example>preact serve --server config
TypeError: Path must be a string. Received undefined

adding a --dest option allows it to succeed. Somehow the default has been dropped, maybe?

$ preact serve --server config --dest firebase.json

@lecstor Thx, that really helps! But I'll keep this issue open until the README is fixed accordingly: https://github.com/developit/preact-cli#deploying

I.s.o. 'fixing' the README, better fix the code ๐Ÿ‘

Was this page helpful?
0 / 5 - 0 ratings