{"id":1189,"hash":"63a264f93cca0bb0401a8a545b577f4c018ad80ae78c34623e6fe805b9a96036","pattern":"Error: proc macro `main` not expanded: Cannot create expander for","full_message":"I want to run a web server with Rust and Actix-Web. After following these steps of their documentation everything works as expected: the server runs on port 8080.\n\nThe problem I have is that VSCode shows errors\n\nThis error message is shown in the tooltip upon hovering the error in the IDE\n\nproc macro main not expanded: Cannot create expander for /Users/name/Documents/projects/project-rust/target/debug/deps/libactix_web_codegen-b262af45f63000f3.dylib: Io(Custom { kind: InvalidData, error: DlOpen { desc: \"dlopen(/Users/name/Documents/projects/project-rust/target/debug/deps/libactix_web_codegen-b262af45f63000f3.dylib, 0x000A): tried: '/Users/name/Documents/projects/project-rust/target/debug/deps/libactix_web_codegen-b262af45f63000f3.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/local/lib/libactix_web_codegen-b262af45f63000f3.dylib' (no such file), '/usr/lib/libactix_web_codegen-b262af45f63000f3.dylib' (no such file)\" } })\n\nEnvironemnt - macOS Monterey 12.1 (M1)","ecosystem":"cargo","package_name":"actix-web","package_version":null,"solution":"VS Code\n\nThanks, @Smitop for the tip\n\nI reinstalled VSCode with universal build and the errors are gone\n\nP.S. I tried to install the build for Apple Silicon, but it didn't help\n\nNVIM (macOS, arm64, m1)\n\nFor those experiencing the same issue in NeoVim, the following steps helped resolve the errors.\n\nOpen a terminal\nExecute rustup toolchain list\n\nIt should print\n\nstable-aarch64-apple-darwin (default)\nstable-x86_64-apple-darwin \n\nCopy the stable-x86_64-apple-darwin and make it default, by using rustup default stable-x86_64-apple-darwin\nRe-open NeoVim.\nErrors should disappear","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/72732296/error-proc-macro-main-not-expanded-cannot-create-expander-for","votes":16,"created_at":"2026-04-19T04:52:34.051952+00:00","updated_at":"2026-04-19T04:52:34.051952+00:00"}