preact-cli icon indicating copy to clipboard operation
preact-cli copied to clipboard

'TypeError: props.children is not a function' on a brand new 'default' project

Open peterbe opened this issue 4 years ago • 1 comments

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

What is the current behaviour? 'TypeError: props.children is not a function'

If the current behaviour is a bug, please provide the steps to reproduce. Straight from my zsh history

cd /tmp
npx preact create default sampleapp --yarn
cd sampleapp
yarn start

Then I open http://localhost:8080/ and get this: Screen Shot 2020-03-06 at 9 14 52 PM

What is the expected behaviour? That the app works by default.

Please mention other relevant information.

▶ cat package.json
{
  "name": "sampleapp",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "scripts": {
    "start": "if-env NODE_ENV=production && yarn run -s serve || yarn run -s dev",
    "build": "preact build",
    "serve": "preact build && preact serve",
    "dev": "preact watch",
    "test": "eslint src && preact test"
  },
  "eslintConfig": {
    "extends": "eslint-config-synacor"
  },
  "devDependencies": {
    "eslint": "6.8.0",
    "eslint-config-synacor": "3.0.5",
    "if-env": "1.0.4",
    "preact-cli": "2.2.1"
  },
  "dependencies": {
    "preact": "10.3.3",
    "preact-compat": "3.19.0",
    "preact-router": "3.2.1"
  }
}

Please paste the results of preact info here.

▶ preact info
         ▄▄
     ▄▄▓▓▓▓▓▓▄▄
  ▄█▀▀█▓▓▓▓▓▓▓▀▀█▄▄
▐▓▌▐▓▓▓▒▄ ▀▄▄▓▓▓▌▐▓▌
▐▓▓▄▀▓▀ ▄▓▓▄▄▀▓▓ ▓▓▌
▐▓▓▓▌ ▒▓▌  ▐▓▓  ▓▓▓▌ 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]

Unknown argument: info

peterbe avatar Mar 07 '20 02:03 peterbe

I wonder if it was just an old global install of preact that interfered.

peterbe avatar Mar 07 '20 02:03 peterbe

Can't reproduce; might've been fixed, might've been a global install as you say, might've been an old service worker perhaps?

rschristian avatar Dec 22 '22 08:12 rschristian