-
Notifications
You must be signed in to change notification settings - Fork 1
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
Shorthand setState #21
Comments
Morning Oliver and thanks for taking the time to review our (messy...)
code. We've been trying to deploy our project on Netlify, but keep on
getting errors. Would you mind taking a look at the log in case you can
help us work out how to fix whatever we're doing wrong? I'm pasting it
below.
Cheers,
Artemis
…--------------------------------------------------------------------------------------
10:29:41 AM: Build ready to start 10:29:42 AM: build-image version:
42bca793ccd33055023c56c4ca8510463a56d317 10:29:42 AM: buildbot version:
6bab8b64bbd90091082af19fedf16bf73d502e5e 10:29:42 AM: Fetching cached
dependencies 10:29:42 AM: Failed to fetch cache, continuing with build
10:29:42 AM: Starting to prepare the repo for build 10:29:43 AM: No cached
dependencies found. Cloning fresh repo 10:29:43 AM: git clone
[email protected]:fac-14/bustzombie 10:29:44 AM: Preparing Git Reference
pull/20/head 10:29:45 AM: Starting build script 10:29:45 AM: Installing
dependencies 10:29:46 AM: Downloading and installing node v8.12.0...
10:29:46 AM: Downloading
https://nodejs.org/dist/v8.12.0/node-v8.12.0-linux-x64.tar.xz... 10:29:46
AM: # 10:29:46 AM: 1.6% 10:29:47 AM: ################## 10:29:47 AM: 26.1%
10:29:47 AM: ############################################ 10:29:47 AM:
62.3% 10:29:47 AM:
################################################################## 10:29:47
AM: ### 97.2%
########################################################################
100.0% 10:29:47 AM: Computing checksum with sha256sum 10:29:47 AM:
Checksums matched! 10:29:49 AM: Now using node v8.12.0 (npm v6.4.1)
10:29:49 AM: Attempting ruby version 2.3.6, read from environment 10:29:50
AM: Using ruby version 2.3.6 10:29:50 AM: Using PHP version 5.6 10:29:50
AM: Started restoring cached node modules 10:29:50 AM: Finished restoring
cached node modules 10:29:50 AM: Installing NPM modules using NPM version
6.4.1 10:30:14 AM: > [email protected] install
/opt/build/repo/node_modules/deasync 10:30:14 AM: > node ./build.js
10:30:15 AM: `linux-x64-node-8` exists; testing 10:30:15 AM: Binary is
fine; exiting 10:30:15 AM: > [email protected] postinstall
/opt/build/repo/node_modules/parcel-bundler 10:30:15 AM: > node -e
"console.log('\u001b[35m\u001b[1mLove Parcel? You can now donate to our
open collective:\u001b[22m\u001b[39m\n > \u001b[34mhttps://
opencollective.com/parcel/donate\u001b[0m')" 10:30:15 AM: Love Parcel? You
can now donate to our open collective: 10:30:15 AM: >
https://opencollective.com/parcel/donate 10:30:17 AM: npm 10:30:17 AM: WARN
[email protected] No repository field. 10:30:17 AM: npm WARN optional
SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
10:30:17 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported
platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current:
{"os":"linux","arch":"x64"}) 10:30:17 AM: added 1450 packages from 692
contributors and audited 29131 packages in 26.319s 10:30:18 AM: found 0
vulnerabilities 10:30:18 AM: NPM modules installed 10:30:18 AM: Started
restoring cached go cache 10:30:18 AM: Finished restoring cached go cache
10:30:18 AM: unset GOOS; 10:30:18 AM: unset GOARCH; 10:30:18 AM: export
GOROOT='/opt/buildhome/.gimme/versions/go1.10.linux.amd64'; 10:30:18 AM:
export
PATH="/opt/buildhome/.gimme/versions/go1.10.linux.amd64/bin:${PATH}";
10:30:18 AM: go version >&2; 10:30:18 AM: export
GIMME_ENV='/opt/buildhome/.gimme/env/go1.10.linux.amd64.env'; 10:30:18 AM:
go version go1.10 linux/amd64 10:30:18 AM: Installing missing commands
10:30:18 AM: Verify run directory 10:30:18 AM: Executing user command: npm
run-script build 10:30:18 AM: > [email protected] build /opt/build/repo
10:30:18 AM: > parcel build index.html 10:30:19 AM: 🚨 No entries found.
10:30:19 AM: at Bundler.bundle
(/opt/build/repo/node_modules/parcel-bundler/src/Bundler.js:260:17)
10:30:19 AM: at <anonymous> 10:30:19 AM: npm 10:30:19 AM: ERR! code
ELIFECYCLE 10:30:19 AM: npm ERR! errno 1 10:30:19 AM: npm ERR!
[email protected] build: `parcel build index.html` 10:30:19 AM: npm ERR!
Exit status 1 10:30:19 AM: npm ERR! 10:30:19 AM: npm ERR! Failed at the
[email protected] build script. 10:30:19 AM: npm ERR! This is probably not a
problem with npm. There is likely additional logging output above. 10:30:19
AM: npm ERR! A complete log of this run can be found in: 10:30:19 AM: npm
ERR! /opt/buildhome/.npm/_logs/2018-09-28T09_30_19_696Z-debug.log 10:30:19
AM: Caching artifacts 10:30:19 AM: Started saving node modules 10:30:19 AM:
Finished saving node modules 10:30:19 AM: Started saving pip cache 10:30:19
AM: Finished saving pip cache 10:30:19 AM: Started saving emacs cask
dependencies 10:30:19 AM: Finished saving emacs cask dependencies 10:30:19
AM: Started saving maven dependencies 10:30:19 AM: Finished saving maven
dependencies 10:30:19 AM: Started saving boot dependencies 10:30:19 AM:
Finished saving boot dependencies 10:30:19 AM: Started saving go
dependencies 10:30:20 AM: Finished saving go dependencies 10:30:20 AM:
Cached node version v8.12.0 10:30:20 AM: Error running command: Build
script returned non-zero exit code: 1 10:30:20 AM: Failing build: Failed to
build site 10:30:20 AM: failed during stage 'building site': Build script
returned non-zero exit code: 1 10:30:20 AM: Finished processing build
request in 37.790492736s
On Fri, Sep 28, 2018 at 10:31 AM Oliver ***@***.***> wrote:
It might be a bit easier to use the shorthand for setState when you don't
need to access prevState.
e.g.
this.setState(prevState => {
return { firstZombieAppeared: true };
})
to
this.setState({ firstZombieAppeared: true })
See the docs <https://reactjs.org/docs/react-component.html#setstate> for
more info
You may optionally pass an object as the first argument to setState()
instead of a function
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#21>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AgIH_6Rmjt-ztjl6PM2qqo4ZJiXH_4aRks5ufexlgaJpZM4W-KoK>
.
|
Hmm looks like a test script is failing?
What did you configure as your build script on Netlify? |
Hi Oliver,
That's what's in our .JSON:
"build": "parcel build index.html"
We had a look at your example in #22. In this line
Array.from({ length: 9 }, (_, index)
is the underscore standard syntax or does it depend on a particular library?
Thanks.
…On Fri, Sep 28, 2018 at 11:16 AM Oliver ***@***.***> wrote:
Hmm looks like a test script is failing?
npm ERR! Failed at the ***@***.*** build script
What did you configure as your build script on Netlify?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#21 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AgIH_2vc4DC8lTjnveWBHFC_WUoPNK1Qks5uffcHgaJpZM4W-KoK>
.
|
Ah spotted why the build is failing: "start": "parcel public/index.html",
"build": "parcel build index.html" The build script needs to point to |
The underscore is standard syntax, it's just a convention for naming a function parameter you aren't going to use (you have to put something there so you can get to the |
Thanks! We'll try it out as you suggest.
…On Fri, Sep 28, 2018 at 12:29 PM Oliver ***@***.***> wrote:
Ah spotted why the build is failing:
"start": "parcel public/index.html","build": "parcel build index.html"
The build script needs to point to public/index.html too
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#21 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AgIH_8uBL_E4im3sKa10KvmXvEGal3Ryks5ufggngaJpZM4W-KoK>
.
|
It might be a bit easier to use the shorthand for
setState
when you don't need to accessprevState
.e.g.
to
See the docs for more info
The text was updated successfully, but these errors were encountered: