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

preact build --json fails with TypeError: c.getModules is not a function #467

Closed
jeberly opened this issue Jan 19, 2018 · 6 comments · Fixed by #472
Closed

preact build --json fails with TypeError: c.getModules is not a function #467

jeberly opened this issue Jan 19, 2018 · 6 comments · Fixed by #472

Comments

@jeberly
Copy link

jeberly commented Jan 19, 2018

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

What is the current behaviour?
preact build --json fails with TypeError: c.getModules is not a function

If the current behaviour is a bug, please provide the steps to reproduce.
I made sure I have latest preact-cli and webpack, etc. I created a new preact-cli app with preact create default my-project ran preact build --json got error.

What is the expected behaviour?
to actually output build stats json file

Please mention other relevant information.

  • Node version
    v9.4.0
  • npm version
    5.6.0
  • Operating system
    MacOS 10.13.2 (17C205)
  • webpack version
    3.10.0
  • CLI version
    preact-cli 2.1.1
  • Browser
@esperancaJS
Copy link

I'm also getting this

@louisremi
Copy link

This looks a lot like a regression that occurred between 2.1.0 and 2.1.1
Today I realized my website wouldn't build on Netlify's CI while it was building fine locally. I was running react-cli 2.1.0 locally while Netlify was installing react-cli 2.1.1
I tried updating my local react-cli to 2.1.1 and the TypeError: c.getModules appeared. I downgraded immediatly after back to 2.1.0 and build worked as expected, both locally and on Netlify.

Current workaround: downgrade to react-cli 2.1.0

@ForsakenHarmony
Copy link
Member

Yup, seems like c.getModules doesn't exist anymore, it's just c.modules now

@lukeed
Copy link
Member

lukeed commented Jan 27, 2018

@ForsakenHarmony
Copy link
Member

Guessing you'd just remove the whole ternary operator and just replace it with c.modules

@reznord
Copy link
Member

reznord commented Jan 27, 2018

mapModules is still usable, only getModules is deprecated. So I guess ternary is safe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants