kentcdodds/testing-react-apps

Error when npm start

theoradicella opened this issue · 10 comments

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/opt/homebrew/Cellar/node@12/12.22.4/bin/node',
1 verbose cli   '/opt/homebrew/bin/npm',
1 verbose cli   'start'
1 verbose cli ]
2 info using npm@6.14.14
3 info using node@v12.22.4
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle testing-react-applications-workshop@1.0.0~prestart: testing-react-applications-workshop@1.0.0
6 info lifecycle testing-react-applications-workshop@1.0.0~start: testing-react-applications-workshop@1.0.0
7 verbose lifecycle testing-react-applications-workshop@1.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle testing-react-applications-workshop@1.0.0~start: PATH: /opt/homebrew/Cellar/node@12/12.22.4/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/theo/Desktop/testing-react-apps/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin:/opt/homebrew/sbin
9 verbose lifecycle testing-react-applications-workshop@1.0.0~start: CWD: /Users/theo/Desktop/testing-react-apps
10 silly lifecycle testing-react-applications-workshop@1.0.0~start: Args: [ '-c', 'react-scripts start' ]
11 silly lifecycle testing-react-applications-workshop@1.0.0~start: Returned: code: 1  signal: null
12 info lifecycle testing-react-applications-workshop@1.0.0~start: Failed to exec start script
13 verbose stack Error: testing-react-applications-workshop@1.0.0 start: `react-scripts start`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/opt/homebrew/Cellar/node@12/12.22.4/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:314:20)
13 verbose stack     at ChildProcess.<anonymous> (/opt/homebrew/Cellar/node@12/12.22.4/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:314:20)
13 verbose stack     at maybeClose (internal/child_process.js:1022:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
14 verbose pkgid testing-react-applications-workshop@1.0.0
15 verbose cwd /Users/theo/Desktop/testing-react-apps
16 verbose Darwin 20.6.0
17 verbose argv "/opt/homebrew/Cellar/node@12/12.22.4/bin/node" "/opt/homebrew/bin/npm" "start"
18 verbose node v12.22.4
19 verbose npm  v6.14.14
20 error code ELIFECYCLE
21 error errno 1
22 error testing-react-applications-workshop@1.0.0 start: `react-scripts start`
22 error Exit status 1
23 error Failed at the testing-react-applications-workshop@1.0.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Could you try setting up the whole project all over from scratch and copy/paste all the output from that?

theo@Theos-MBP Desktop % git clone https://github.com/kentcdodds/testing-react-apps.git
cd testing-react-apps
node setup

Cloning into 'testing-react-apps'...
remote: Enumerating objects: 1454, done.
remote: Counting objects: 100% (352/352), done.
remote: Compressing objects: 100% (95/95), done.
remote: Total 1454 (delta 293), reused 272 (delta 257), pack-reused 1102
Receiving objects: 100% (1454/1454), 2.23 MiB | 1.49 MiB/s, done.
Resolving deltas: 100% (987/987), done.
▶️  Starting workshop setup...
      Running the following command: npx "https://gist.github.com/kentcdodds/bb452ffe53a5caa3600197e1d8005733" -q
npx: installed 1 in 4.188s
    ▶️  Starting: System Validation
          Ensuring the correct versions of tools are installed on this computer.
          Running the following command: npx "https://gist.github.com/kentcdodds/abbc32701f78fa70298d444c2303b6d9"
npx: installed 2 in 3.72s
    ✅  Success: System Validation


    ▶️  Starting: Dependency Installation
          Installing third party code dependencies so the workshop works properly on this computer.
          Running the following command: npm install --legacy-peer-deps --no-save

> fsevents@1.2.13 install /Users/theo/Desktop/testing-react-apps/node_modules/watchpack-chokidar2/node_modules/fsevents
> node install.js

  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
  SOLINK_MODULE(target) Release/fse.node

> fsevents@1.2.13 install /Users/theo/Desktop/testing-react-apps/node_modules/webpack-dev-server/node_modules/fsevents
> node install.js

  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
  SOLINK_MODULE(target) Release/fse.node

> husky@4.3.8 install /Users/theo/Desktop/testing-react-apps/node_modules/husky
> node husky install

husky > Setting up git hooks
husky > Done

> core-js@2.6.12 postinstall /Users/theo/Desktop/testing-react-apps/node_modules/babel-runtime/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> core-js@3.14.0 postinstall /Users/theo/Desktop/testing-react-apps/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"


> core-js-pure@3.14.0 postinstall /Users/theo/Desktop/testing-react-apps/node_modules/core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"


> ejs@2.7.4 postinstall /Users/theo/Desktop/testing-react-apps/node_modules/ejs
> node ./postinstall.js

Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)


> husky@4.3.8 postinstall /Users/theo/Desktop/testing-react-apps/node_modules/husky
> opencollective-postinstall || exit 0

Thank you for using husky!
If you rely on this package, please consider supporting our open collective:
> https://opencollective.com/husky/donate


> msw@0.29.0 postinstall /Users/theo/Desktop/testing-react-apps/node_modules/msw
> node -e "try{require('./config/scripts/postinstall')}catch(e){}"

added 1978 packages from 860 contributors and audited 1981 packages in 12.432s

160 packages are looking for funding
  run `npm fund` for details

found 87 vulnerabilities (85 moderate, 2 high)
  run `npm audit fix` to fix them, or `npm audit` for details
    ✅  Success: Dependency Installation


    ▶️  Starting: Project Validation
          Running validation checks to ensure dependencies were installed properly
          Running the following command: npm run validate -s

 RUNS  src/__tests__/final/05.extra-3.js
 PASS  src/__tests__/final/04.extra-3.js
 PASS  src/__tests__/exercise/05.js
 PASS  src/__tests__/final/05.extra-3.js
 PASS  src/__tests__/final/05.js
 PASS  src/__tests__/final/05.extra-2.js
 PASS  src/__tests__/final/04.extra-2.js
 PASS  src/__tests__/final/05.extra-4.js
 PASS  src/__tests__/final/06.extra-1.js
 PASS  src/__tests__/final/04.extra-4.js
 PASS  src/__tests__/final/04.js
 PASS  src/__tests__/final/03.extra-1.js
 PASS  src/__tests__/final/04.extra-1.js
 PASS  src/__tests__/final/07.extra-2.js
 PASS  src/__tests__/exercise/07.js
 PASS  src/__tests__/final/08.js
 PASS  src/__tests__/final/07.js
 PASS  src/__tests__/final/03.js
 PASS  src/__tests__/final/07.extra-3.js
 PASS  src/__tests__/final/01.extra-1.js
 PASS  src/__tests__/final/06.extra-2.js
 PASS  src/__tests__/exercise/06.js
 PASS  src/__tests__/exercise/03.js
 PASS  src/__tests__/final/06.js
 PASS  src/__tests__/final/07.extra-1.js
 PASS  src/__tests__/final/02.js
 PASS  src/__tests__/final/05.extra-1.js
 PASS  src/__tests__/final/01.js
 PASS  src/__tests__/exercise/08.js
 PASS  src/__tests__/exercise/02.js
 PASS  src/__tests__/final/08.extra-3.js
 PASS  src/__tests__/final/02.extra-1.js
 PASS  src/__tests__/final/08.extra-1.js
 PASS  src/__tests__/exercise/01.js
 PASS  src/__tests__/exercise/04.js
 PASS  src/__tests__/final/08.extra-2.js

Test Suites: 35 passed, 35 total
Tests:       48 passed, 48 total
Snapshots:   2 passed, 2 total
Time:        3.821 s
Ran all test suites.
Compiled successfully.

File sizes after gzip:

  94.04 KB  build/static/js/2.ddd2c502.chunk.js
  1.24 KB   build/static/js/runtime-main.68f8cff7.js
  1.15 KB   build/static/js/4.8f38a53b.chunk.js
  1.13 KB   build/static/js/main.64ee5c34.chunk.js
  958 B     build/static/js/8.a0d99495.chunk.js
  929 B     build/static/js/3.7c65d163.chunk.js
  452 B     build/static/js/6.e969c5cf.chunk.js
  433 B     build/static/js/5.15e4d95d.chunk.js
  345 B     build/static/js/7.456a7e37.chunk.js
  317 B     build/static/css/main.d51dbcf0.chunk.css

The project was built assuming it is hosted at /.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.
You may serve it with a static server:

  npm install -g serve
  serve -s build

Find out more about deployment here:

  https://cra.link/deployment

    ✅  Success: Project Validation


    ▶️  Starting: Autofilling Email
          Each exercise comes with a elaboration form to help your retention. Providing your email now will mean you don't have to provide it each time you fill out the form.
          Running the following command: npx "https://gist.github.com/kentcdodds/2d44448a8997b9964b1be44cd294d1f5"
npx: installed 86 in 6.553s
? What's your email address? theoradicella@gmail.com
Updated 8 files with the email theoradicella@gmail.com
Committing changes for you so your jest watch mode works nicely
[main c3425e2] email autofill
 Committer: Theo Radicella <theo@Theos-MBP.fibertel.com.ar>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly. Run the
following command and follow the instructions in your editor to edit
your configuration file:

    git config --global --edit

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author

 8 files changed, 8 insertions(+), 8 deletions(-)
    ✅  Success: Autofilling Email


✅  Workshop setup complete...

That looks alright. Do you get the same problem when running npm start in the new project?

Starting the development server...

<--- Last few GCs --->

[36824:0x130008000] 1004 ms: Scavenge 67.3 (87.3) -> 59.7 (91.0) MB, 2.1 / 0.0 ms (average mu = 0.993, current mu = 0.993) allocation failure
[36824:0x130008000] 1030 ms: Scavenge 71.4 (91.3) -> 66.3 (95.5) MB, 1.6 / 0.0 ms (average mu = 0.993, current mu = 0.993) allocation failure
[36824:0x130008000] 1079 ms: Scavenge 77.0 (96.5) -> 68.9 (103.5) MB, 1.8 / 0.0 ms (average mu = 0.993, current mu = 0.993) allocation failure

<--- JS stacktrace --->

FATAL ERROR: wasm code commit Allocation failed - process out of memory
1: 0x10270d198 node::Abort() [/opt/homebrew/Cellar/node@12/12.22.4/bin/node]
2: 0x10270d318 std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >::basic_stringstd::nullptr_t(char const*) [/opt/homebrew/Cellar/node@12/12.22.4/bin/node]
3: 0x10281317c v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/opt/homebrew/Cellar/node@12/12.22.4/bin/node]
4: 0x102813110 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/opt/homebrew/Cellar/node@12/12.22.4/bin/node]
5: 0x102c4150c v8::internal::wasm::WasmCodeAllocator::AllocateForCodeInRegion(v8::internal::wasm::NativeModule*, unsigned long, v8::base::AddressRegion) [/opt/homebrew/Cellar/node@12/12.22.4/bin/node]
6: 0x102c42184 v8::internal::wasm::NativeModule::CreateEmptyJumpTableInRegion(unsigned int, v8::base::AddressRegion) [/opt/homebrew/Cellar/node@12/12.22.4/bin/node]
7: 0x102c41750 v8::internal::wasm::NativeModule::AddCodeSpace(v8::base::AddressRegion) [/opt/homebrew/Cellar/node@12/12.22.4/bin/node]
8: 0x102c41fcc v8::internal::wasm::NativeModule::NativeModule(v8::internal::wasm::WasmEngine*, v8::internal::wasm::WasmFeatures const&, bool, v8::internal::VirtualMemory, std::__1::shared_ptr<v8::internal::wasm::WasmModule const>, std::__1::shared_ptrv8::internal::Counters, std::__1::shared_ptrv8::internal::wasm::NativeModule) [/opt/homebrew/Cellar/node@12/12.22.4/bin/node]
9: 0x102c43eac v8::internal::wasm::WasmCodeManager::NewNativeModule(v8::internal::wasm::WasmEngine
, v8::internal::Isolate*, v8::internal::wasm::WasmFeatures const&, unsigned long, bool, std::__1::shared_ptr<v8::internal::wasm::WasmModule const>) [/opt/homebrew/Cellar/node@12/12.22.4/bin/node]
10: 0x102c4a1d8 v8::internal::wasm::WasmEngine::NewNativeModule(v8::internal::Isolate*, v8::internal::wasm::WasmFeatures const&, unsigned long, bool, std::__1::shared_ptr<v8::internal::wasm::WasmModule const>) [/opt/homebrew/Cellar/node@12/12.22.4/bin/node]
11: 0x102c4a120 v8::internal::wasm::WasmEngine::NewNativeModule(v8::internal::Isolate*, v8::internal::wasm::WasmFeatures const&, std::__1::shared_ptr<v8::internal::wasm::WasmModule const>) [/opt/homebrew/Cellar/node@12/12.22.4/bin/node]
12: 0x102c28910 v8::internal::wasm::AsyncCompileJob::CreateNativeModule(std::__1::shared_ptr<v8::internal::wasm::WasmModule const>) [/opt/homebrew/Cellar/node@12/12.22.4/bin/node]
13: 0x102c2fdc8 v8::internal::wasm::AsyncCompileJob::PrepareAndStartCompile::RunInForeground(v8::internal::wasm::AsyncCompileJob*) [/opt/homebrew/Cellar/node@12/12.22.4/bin/node]
14: 0x102c3056c v8::internal::wasm::AsyncCompileJob::CompileStep::Run(v8::internal::wasm::AsyncCompileJob*, bool) [/opt/homebrew/Cellar/node@12/12.22.4/bin/node]
15: 0x102c3047c v8::internal::wasm::AsyncCompileJob::CompileTask::RunInternal() [/opt/homebrew/Cellar/node@12/12.22.4/bin/node]
16: 0x102762c34 node::PerIsolatePlatformData::RunForegroundTask(std::__1::unique_ptr<v8::Task, std::__1::default_deletev8::Task >) [/opt/homebrew/Cellar/node@12/12.22.4/bin/node]
17: 0x102761e5c node::PerIsolatePlatformData::FlushForegroundTasksInternal() [/opt/homebrew/Cellar/node@12/12.22.4/bin/node]
18: 0x102d569bc uv__async_io [/opt/homebrew/Cellar/node@12/12.22.4/bin/node]
19: 0x102d66544 uv__io_poll [/opt/homebrew/Cellar/node@12/12.22.4/bin/node]
20: 0x102d56ddc uv_run [/opt/homebrew/Cellar/node@12/12.22.4/bin/node]
21: 0x102743008 node::NodeMainInstance::Run() [/opt/homebrew/Cellar/node@12/12.22.4/bin/node]
22: 0x1026e9e20 node::Start(int, char**) [/opt/homebrew/Cellar/node@12/12.22.4/bin/node]
23: 0x189c69430 start [/usr/lib/system/libdyld.dylib]
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! testing-react-applications-workshop@1.0.0 start: react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the testing-react-applications-workshop@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/theo/.npm/_logs/2021-08-18T23_06_02_580Z-debug.log
theo@Theos-MBP testing-react-apps %

Yes, same error

what could this be?

Huh, I really have no idea I'm afraid 😬 Do the other workshops work?

Luckily enough for this workshop you actually don't need to make any changes to the app itself. Your exercises are all in the tests and those appear to run without trouble. You can pull up the deployed version of the app here: https://testing-react-apps.netlify.app/ With that you should be able to have enough to get going. Alternatively you could try using the docker solution or the codesandbox as mentioned in the README. Sorry :(

Ok, thanks!

@theoradicella This might be a long shot but it might be a node version issue on certain mobile chips, there are a few possible solutions here

https://stackoverflow.com/questions/65856300/wasm-code-commit-allocation-failed-process-out-of-memory

That's probably it, since I've got the new M1 Apple chip. Thanks @benpetersen