Preact: 10.0.3 — Uncaught TypeError: Cannot read property 'push' of undefined

Created on 29 Oct 2019  ·  4Comments  ·  Source: preactjs/preact

Hi there,

My project stopped working when upgrading to Preact 10.0.3 a few minutes ago. This change was later reverted, but you can find the source code in its current state here: https://github.com/next/zeiw-client. If you want to reproduce the error, feel free to clone that repository and upgrade Preact to 10.0.3 👍

image

And here's the failing preact.config.js causing the error:

import child_process from 'child_process'
import webpack from 'webpack'

const commitHash = child_process
  .execSync('git rev-parse HEAD')
  .toString()
  .trim()

export default ({ plugins }) => {
  plugins.push(
    new webpack.DefinePlugin({
      '_zeiwBuild.commitHash': JSON.stringify(commitHash)
    })
  )
}

Kind regards,
Hampus Kraft.

Most helpful comment

There's a PR with the fix and a patch release will soon be there :)

All 4 comments

I have just upgrade as well and i get another error on the hooks file
hooks.module.js:1 Uncaught TypeError: Cannot read property 'forEach' of undefined at hooks.module.js:1 at Array.some (<anonymous>) at Object../node_modules/preact/hooks/dist/hooks.module.js.preact__WEBPACK_IMPORTED_MODULE_0__.options.__c (hooks.module.js:1) at $ (preact.module.js:1) at H (preact.module.js:1)

I didn't create a new issue as maybe could be related because is the same file

I'm getting an error similar to yours @Raul-MultiSafepay.

Here's the stack trace:

Screen Shot 2019-10-29 at 3 39 38 PM

There's a PR with the fix and a patch release will soon be there :)

This issue has been resolved in v10.0.4. We'll look into options to prevent a future reoccurrences.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kay-is picture kay-is  ·  3Comments

matthewmueller picture matthewmueller  ·  3Comments

simonjoom picture simonjoom  ·  3Comments

marcosguti picture marcosguti  ·  3Comments

nopantsmonkey picture nopantsmonkey  ·  3Comments