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.
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 ๐
Most helpful comment
adding a
--destoption allows it to succeed. Somehow the default has been dropped, maybe?