question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Apple Silicon / arm64 / M1 compatibility?

See original GitHub issue

Hi,

We’re using & loving react-refresh-webpack-plugin - thank you!

Recently Apple Silicon came out with arch64-based CPUs. Somehow, this plugin breaks on that architecture with a strange error as reported at https://github.com/facebook/create-react-app/issues/10090

The error looks like this on node=15.2.1 npm=7.0.10 platform=darwin arch=arm64 -

Starting the development server...


<--- Last few GCs --->

[23567:0x148008000]      705 ms: Scavenge 62.1 (89.8) -> 51.2 (89.8) MB, 1.0 / 0.0 ms  (average mu = 0.992, current mu = 0.992) allocation failure 
[23567:0x148008000]      784 ms: Scavenge 67.7 (90.0) -> 57.3 (91.7) MB, 1.2 / 0.0 ms  (average mu = 0.992, current mu = 0.992) allocation failure 


<--- JS stacktrace --->

FATAL ERROR: WasmCodeManager::Commit: Cannot make pre-reserved region writable Allocation failed - process out of memory
 1: 0x10053def4 node::Abort() [/opt/homebrew/Cellar/node/15.2.1/bin/node]
 2: 0x10053e074 std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string<std::nullptr_t>(char const*) [/opt/homebrew/Cellar/node/15.2.1/bin/node]
 3: 0x100663dd8 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/opt/homebrew/Cellar/node/15.2.1/bin/node]
 4: 0x100663d6c v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/opt/homebrew/Cellar/node/15.2.1/bin/node]
 5: 0x100b00418 v8::internal::wasm::WasmCodeManager::Commit(v8::base::AddressRegion) [/opt/homebrew/Cellar/node/15.2.1/bin/node]
 6: 0x100b00008 v8::internal::wasm::WasmCodeAllocator::AllocateForCodeInRegion(v8::internal::wasm::NativeModule*, unsigned long, v8::base::AddressRegion, v8::internal::wasm::WasmCodeAllocator::OptionalLock const&) [/opt/homebrew/Cellar/node/15.2.1/bin/node]
 7: 0x100b00cfc v8::internal::wasm::NativeModule::CreateEmptyJumpTableInRegion(int, v8::base::AddressRegion, v8::internal::wasm::WasmCodeAllocator::OptionalLock const&) [/opt/homebrew/Cellar/node/15.2.1/bin/node]
 8: 0x100affc18 v8::internal::wasm::NativeModule::AddCodeSpace(v8::base::AddressRegion, v8::internal::wasm::WasmCodeAllocator::OptionalLock const&) [/opt/homebrew/Cellar/node/15.2.1/bin/node]
 9: 0x100b00b18 v8::internal::wasm::NativeModule::NativeModule(v8::internal::wasm::WasmEngine*, v8::internal::wasm::WasmFeatures const&, v8::internal::VirtualMemory, std::__1::shared_ptr<v8::internal::wasm::WasmModule const>, std::__1::shared_ptr<v8::internal::Counters>, std::__1::shared_ptr<v8::internal::wasm::NativeModule>*) [/opt/homebrew/Cellar/node/15.2.1/bin/node]
10: 0x100b02b78 v8::internal::wasm::WasmCodeManager::NewNativeModule(v8::internal::wasm::WasmEngine*, v8::internal::Isolate*, v8::internal::wasm::WasmFeatures const&, unsigned long, std::__1::shared_ptr<v8::internal::wasm::WasmModule const>) [/opt/homebrew/Cellar/node/15.2.1/bin/node]
11: 0x100b0f320 v8::internal::wasm::WasmEngine::NewNativeModule(v8::internal::Isolate*, v8::internal::wasm::WasmFeatures const&, std::__1::shared_ptr<v8::internal::wasm::WasmModule const>, unsigned long) [/opt/homebrew/Cellar/node/15.2.1/bin/node]
12: 0x100adeee0 v8::internal::wasm::AsyncCompileJob::CreateNativeModule(std::__1::shared_ptr<v8::internal::wasm::WasmModule const>, unsigned long) [/opt/homebrew/Cellar/node/15.2.1/bin/node]
13: 0x100adf094 v8::internal::wasm::AsyncCompileJob::GetOrCreateNativeModule(std::__1::shared_ptr<v8::internal::wasm::WasmModule const>, unsigned long) [/opt/homebrew/Cellar/node/15.2.1/bin/node]
14: 0x100ae6ec8 v8::internal::wasm::AsyncCompileJob::PrepareAndStartCompile::RunInForeground(v8::internal::wasm::AsyncCompileJob*) [/opt/homebrew/Cellar/node/15.2.1/bin/node]
15: 0x100ae6cf0 v8::internal::wasm::AsyncCompileJob::CompileStep::Run(v8::internal::wasm::AsyncCompileJob*, bool) [/opt/homebrew/Cellar/node/15.2.1/bin/node]
16: 0x100ae6c00 v8::internal::wasm::AsyncCompileJob::CompileTask::RunInternal() [/opt/homebrew/Cellar/node/15.2.1/bin/node]
17: 0x100592aa0 node::PerIsolatePlatformData::RunForegroundTask(std::__1::unique_ptr<v8::Task, std::__1::default_delete<v8::Task> >) [/opt/homebrew/Cellar/node/15.2.1/bin/node]
18: 0x100591b94 node::PerIsolatePlatformData::FlushForegroundTasksInternal() [/opt/homebrew/Cellar/node/15.2.1/bin/node]
19: 0x100c0527c uv__async_io [/opt/homebrew/Cellar/node/15.2.1/bin/node]
20: 0x100c14df0 uv__io_poll [/opt/homebrew/Cellar/node/15.2.1/bin/node]
21: 0x100c0569c uv_run [/opt/homebrew/Cellar/node/15.2.1/bin/node]
22: 0x1004a3960 node::SpinEventLoop(node::Environment*) [/opt/homebrew/Cellar/node/15.2.1/bin/node]
23: 0x100571ef8 node::NodeMainInstance::Run(node::EnvSerializeInfo const*) [/opt/homebrew/Cellar/node/15.2.1/bin/node]
24: 0x100518ff4 node::Start(int, char**) [/opt/homebrew/Cellar/node/15.2.1/bin/node]
25: 0x190ae8f54 start [/usr/lib/system/libdyld.dylib]

The reproduction case is simple -

npx create-react-app my-app
cd my-app
npm start # Triggers the errors
env FAST_REFRESH=false npm start   # <-- The app work

I do not use create-react-app, and use this plugin directly - but experience exactly the same failure case with webpack 4 as in that issue. If I comment out the line that adds this plugin and make no other changes, everything else works as expected.

Do you have any guesses why the plugin would fail with WASM-related errors on the Apple arch64 / M1 chip?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:24
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

23reactions
pmmmwhcommented, Nov 24, 2020

THIS HAVE BEEN FIXED IN NODEJS 15.3.0 🎉

21reactions
samturnercommented, Feb 8, 2021

For anyone else that has this issue and can’t move to Node 15 (my project requires 12 at this point in time): I resolved it by uninstalling Node 12 and re-installing it under Rosetta.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Apple M1 Processor Overview and Compatibility - Toptal
The Apple M1 chip features four big Firestorm CPU cores for high-load scenarios, backed by four smaller Icestorm CPU cores designed for efficiency....
Read more >
Product Compatibility for Apple M1 Silicon Macs (Updated 14 ...
Yes, it is M1 compatible ! Frischluft. Flair v1.2.11 for After Effects Fresh Curves v1.16 for After Effects Lenscare v1.4.11 for After Effects...
Read more >
Mac computers with Apple silicon
Mac computers with Apple silicon · MacBook Air (M2, 2022) · MacBook Pro (13-inch, M2, 2022) · Mac Studio (2022) · MacBook Pro...
Read more >
Apple Silicon: The Complete Guide - MacRumors
Apple's first Macs with Apple silicon chips, the late 2020 ... The 2021 14-inch and 16-inch MacBook Pro models use the M1 Pro...
Read more >
Running x86_64-based containers on Mac computers with an ...
... an Apple Silicon (M1) processor, which is an ARM64 architecture. ... or on the x86_64 VM when these types of compatibility issues...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found