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

Prettier is trapping when evaluating a prisma file #3

Closed
ajotaos opened this issue Feb 16, 2021 · 2 comments
Closed

Prettier is trapping when evaluating a prisma file #3

ajotaos opened this issue Feb 16, 2021 · 2 comments

Comments

@ajotaos
Copy link

ajotaos commented Feb 16, 2021

When running npx prisma format schema.prisma everything works great but running npx prettier schema.prisma traps with the following messages, some referring to the wasm engine. I'm running this code in a MacBook Pro M1 with Big Sur 11.2.1.

#
# Fatal error in , line 0
# Check failed: allocator->SetPermissions(reinterpret_cast<void*>(region.begin()), region.size(), PageAllocator::kNoAccess).
#
#
#
#FailureMessage Object: 0x16f752918
 1: 0x1007a5104 node::NodePlatform::GetStackTracePrinter()::$_3::__invoke() [/opt/homebrew/bin/node]
 2: 0x101130054 V8_Fatal(char const*, ...) [/opt/homebrew/bin/node]
 3: 0x100d19358 v8::internal::wasm::WasmCodeAllocator::GetNumCodeSpaces() const [/opt/homebrew/bin/node]
 4: 0x100d191f8 v8::internal::wasm::WasmCodeAllocator::FreeCode(v8::internal::Vector<v8::internal::wasm::WasmCode* const>) [/opt/homebrew/bin/node]
 5: 0x100d1c048 v8::internal::wasm::NativeModule::FreeCode(v8::internal::Vector<v8::internal::wasm::WasmCode* const>) [/opt/homebrew/bin/node]
 6: 0x100d29bcc v8::internal::wasm::WasmEngine::FreeDeadCodeLocked(std::__1::unordered_map<v8::internal::wasm::NativeModule*, std::__1::vector<v8::internal::wasm::WasmCode*, std::__1::allocator<v8::internal::wasm::WasmCode*> >, std::__1::hash<v8::internal::wasm::NativeModule*>, std::__1::equal_to<v8::internal::wasm::NativeModule*>, std::__1::allocator<std::__1::pair<v8::internal::wasm::NativeModule* const, std::__1::vector<v8::internal::wasm::WasmCode*, std::__1::allocator<v8::internal::wasm::WasmCode*> > > > > const&) [/opt/homebrew/bin/node]
 7: 0x100d27bec v8::internal::wasm::WasmEngine::PotentiallyFinishCurrentGC() [/opt/homebrew/bin/node]
 8: 0x100d28e28 v8::internal::wasm::WasmEngine::ReportLiveCodeForGC(v8::internal::Isolate*, v8::internal::Vector<v8::internal::wasm::WasmCode*>) [/opt/homebrew/bin/node]
 9: 0x100d2b548 v8::internal::wasm::(anonymous namespace)::WasmGCForegroundTask::RunInternal() [/opt/homebrew/bin/node]
10: 0x1007a3bc0 node::PerIsolatePlatformData::RunForegroundTask(std::__1::unique_ptr<v8::Task, std::__1::default_delete<v8::Task> >) [/opt/homebrew/bin/node]
11: 0x1007a2cb4 node::PerIsolatePlatformData::FlushForegroundTasksInternal() [/opt/homebrew/bin/node]
12: 0x1007a3d7c node::NodePlatform::DrainTasks(v8::Isolate*) [/opt/homebrew/bin/node]
13: 0x1006b0aa4 node::SpinEventLoop(node::Environment*) [/opt/homebrew/bin/node]
14: 0x100781224 node::NodeMainInstance::Run(node::EnvSerializeInfo const*) [/opt/homebrew/bin/node]
15: 0x100724ce4 node::Start(int, char**) [/opt/homebrew/bin/node]
16: 0x198afdf34 start [/usr/lib/system/libdyld.dylib]
[1]    2979 trace trap  npx prettier schema.prisma
@avocadowastaken
Copy link
Owner

avocadowastaken commented Feb 16, 2021

Hey @ajotaos, looks like issue with Node JS running Wasm binary. Node is not completely stable for arm64 processors https://github.com/nodejs/node/blob/master/BUILDING.md#platform-list

Since Prisma engine is written in Rust, I didn't want to compile multiple binaries or depend on the npm prisma cli package.

Can you check with the latest Node version? If it will not help you can install prettier-plugin-prisma@0.1.2 which had a peer dependency to @prisma/sdk https://github.com/umidbekk/prettier-plugin-prisma/tree/v0.1.2

@avocadowastaken
Copy link
Owner

Looks like this related to nodejs/node#37061 (comment)

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

No branches or pull requests

2 participants