Skip to content

create-functionless-app: Created app cannot synth when using npm #528

@cfraz89

Description

@cfraz89

Synth fails when project is created/deps installed in npm, though not through yarn or pnpm
npm cdk synth results in:


thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: LayoutError', /home/runner/.cargo/registry/src/git.colasdn.top-1ecc6299db9ec823/rkyv-0.7.37/src/impls/core/mod.rs:265:67
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at 'failed to invoke plugin: failed to invoke plugin on 'Some("/home/chris/functionless/new-project/src/app.ts")'

Caused by:
    0: failed to invoke `@functionless/ast-reflection` as js transform plugin at node_modules/@functionless/ast-reflection/ast_reflection.wasm
    1: RuntimeError: unreachable
           at __rust_start_panic (<module>[1581]:0x1470e8)
           at rust_panic (<module>[1574]:0x146e2d)
           at std::panicking::rust_panic_with_hook::h34503c79e5f975a0 (<module>[1573]:0x146daa)
           at std::panicking::begin_panic_handler::{{closure}}::h12a46dd1ec9ad9ef (<module>[1560]:0x146010)
           at std::sys_common::backtrace::__rust_end_short_backtrace::hbfd28f296b351783 (<module>[1559]:0x145f4f)
           at rust_begin_unwind (<module>[1568]:0x1466fa)
           at core::panicking::panic_fmt::h7092b9385b17ba68 (<module>[1666]:0x14d0d1)
           at core::result::unwrap_failed::hcf4dc3db6a31deee (<module>[1705]:0x14eb63)
           at rkyv::impls::core::<impl rkyv::DeserializeUnsized<[U],D> for [T]>::deserialize_unsized::h2f51fdec64c09b49 (<module>[951]:0xfdb43)
           at rkyv::impls::core::<impl rkyv::DeserializeUnsized<[U],D> for [T]>::deserialize_unsized::h2e8a8069be0c9f2f (<module>[399]:0x62b98)
           at swc_common::plugin::serialized::PluginSerializedBytes::deserialize::hf5e85413ebd1458b (<module>[96]:0x1995e)
           at swc_common::plugin::serialized::deserialize_from_ptr::h5296ff6c7163ba5e (<module>[95]:0x196ef)
           at __transform_plugin_process_impl (<module>[525]:0x86526)
           at __transform_plugin_process_impl.command_export (<module>[1766]:0x152883)
    2: unreachable', /usr/local/cargo/registry/src/git.colasdn.top-1ecc6299db9ec823/swc-0.228.0/src/plugin.rs:228:14
stack backtrace:
   0:     0x7f7e0225b19d - <unknown>
   1:     0x7f7e0228334c - <unknown>
   2:     0x7f7e02256a11 - <unknown>
   3:     0x7f7e0225cac5 - <unknown>
   4:     0x7f7e0225c7e6 - <unknown>
   5:     0x7f7e0225d056 - <unknown>
   6:     0x7f7e0225cf47 - <unknown>
   7:     0x7f7e0225b654 - <unknown>
   8:     0x7f7e0225cc79 - <unknown>
   9:     0x7f7e00602233 - <unknown>
  10:     0x7f7e00602323 - <unknown>
  11:     0x7f7e00dd483e - <unknown>
  12:     0x7f7e00ee26ab - <unknown>
  13:     0x7f7e00de1ebd - <unknown>
  14:     0x7f7e00ddb538 - <unknown>
  15:     0x7f7e008943dc - <unknown>
  16:     0x7f7e00896375 - <unknown>
  17:     0x7f7e007b546f - <unknown>
  18:     0x7f7e00888a01 - <unknown>
  19:     0x7f7e008005de - <unknown>
  20:           0xaaf64d - _ZN6v8impl12_GLOBAL__N_123FunctionCallbackWrapper6InvokeERKN2v820FunctionCallbackInfoINS2_5ValueEEE
  21:           0xd396ae - _ZN2v88internal12_GLOBAL__N_119HandleApiCallHelperILb0EEENS0_11MaybeHandleINS0_6ObjectEEEPNS0_7IsolateENS0_6HandleINS0_10HeapObjectEEESA_NS8_INS0_20FunctionTemplateInfoEEENS8_IS4_EENS0_16BuiltinArgumentsE
  22:           0xd3aacf - _ZN2v88internal21Builtin_HandleApiCallEiPmPNS0_7IsolateE
  23:          0x15d5519 - Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit
/home/chris/functionless/new-project/node_modules/@swc/core/index.js:241
            return bindings.transformSync(isModule ? JSON.stringify(src) : src, isModule, toBuffer(newOptions));
                            ^

Error: failed to handle: failed to invoke plugin: failed to invoke plugin on 'Some("/home/chris/functionless/new-project/src/app.ts")'

Caused by:
    0: failed to invoke `@functionless/ast-reflection` as js transform plugin at node_modules/@functionless/ast-reflection/ast_reflection.wasm
    1: RuntimeError: unreachable
           at __rust_start_panic (<module>[1581]:0x1470e8)
           at rust_panic (<module>[1574]:0x146e2d)
           at std::panicking::rust_panic_with_hook::h34503c79e5f975a0 (<module>[1573]:0x146daa)
           at std::panicking::begin_panic_handler::{{closure}}::h12a46dd1ec9ad9ef (<module>[1560]:0x146010)
           at std::sys_common::backtrace::__rust_end_short_backtrace::hbfd28f296b351783 (<module>[1559]:0x145f4f)
           at rust_begin_unwind (<module>[1568]:0x1466fa)
           at core::panicking::panic_fmt::h7092b9385b17ba68 (<module>[1666]:0x14d0d1)
           at core::result::unwrap_failed::hcf4dc3db6a31deee (<module>[1705]:0x14eb63)
           at rkyv::impls::core::<impl rkyv::DeserializeUnsized<[U],D> for [T]>::deserialize_unsized::h2f51fdec64c09b49 (<module>[951]:0xfdb43)
           at rkyv::impls::core::<impl rkyv::DeserializeUnsized<[U],D> for [T]>::deserialize_unsized::h2e8a8069be0c9f2f (<module>[399]:0x62b98)
           at swc_common::plugin::serialized::PluginSerializedBytes::deserialize::hf5e85413ebd1458b (<module>[96]:0x1995e)
           at swc_common::plugin::serialized::deserialize_from_ptr::h5296ff6c7163ba5e (<module>[95]:0x196ef)
           at __transform_plugin_process_impl (<module>[525]:0x86526)
           at __transform_plugin_process_impl.command_export (<module>[1766]:0x152883)
    2: unreachable
    at Compiler.transformSync (/home/chris/functionless/new-project/node_modules/@swc/core/index.js:241:29)
    at Object.transformSync (/home/chris/functionless/new-project/node_modules/@swc/core/index.js:348:21)
    at compile (/home/chris/functionless/new-project/node_modules/@swc/register/lib/node.js:76:22)
    at compileHook (/home/chris/functionless/new-project/node_modules/@swc/register/lib/node.js:91:16)
    at Module._compile (/home/chris/functionless/new-project/node_modules/pirates/lib/index.js:130:29)
    at Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
    at Object.newLoader [as .ts] (/home/chris/functionless/new-project/node_modules/pirates/lib/index.js:141:7)
    at Module.load (node:internal/modules/cjs/loader:1004:32)
    at Function.Module._load (node:internal/modules/cjs/loader:839:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
  code: 'GenericFailure'
}

Attached package-lock.json from npm, and pnpm-local.yaml from pnpm for comparison
package-lock.json.txt
pnpm-lock.yaml.txt

output of pnpm ls --depth 1:

@aws-cdk/aws-appsync-alpha 2.43.1-alpha.0
├── aws-cdk-lib 2.43.1 peer
└── constructs 10.1.116 peer
@functionless/ast-reflection 0.3.2
└── @swc/core 1.3.3 peer
@functionless/language-service 0.0.4
└── functionless 0.23.6 peer
@types/jest 29.1.0
├── expect 29.1.0
└── pretty-format 29.1.0
@types/node 18.7.23
aws-cdk 2.43.1
└── fsevents 2.3.2
aws-cdk-lib 2.43.1
└── constructs 10.1.116 peer
aws-sdk 2.1225.0
├── buffer 4.9.2
├── events 1.1.1
├── ieee754 1.1.13
├── jmespath 0.16.0
├── querystring 0.2.0
├── sax 1.2.1
├── url 0.10.3
├── util 0.12.4
├── uuid 8.0.0
└── xml2js 0.4.19
constructs 10.1.116
esbuild 0.15.9
├── @esbuild/android-arm 0.15.9
├── @esbuild/linux-loong64 0.15.9
├── esbuild-android-64 0.15.9
├── esbuild-android-arm64 0.15.9
├── esbuild-darwin-64 0.15.9
├── esbuild-darwin-arm64 0.15.9
├── esbuild-freebsd-64 0.15.9
├── esbuild-freebsd-arm64 0.15.9
├── esbuild-linux-32 0.15.9
├── esbuild-linux-64 0.15.9
├── esbuild-linux-arm 0.15.9
├── esbuild-linux-arm64 0.15.9
├── esbuild-linux-mips64le 0.15.9
├── esbuild-linux-ppc64le 0.15.9
├── esbuild-linux-riscv64 0.15.9
├── esbuild-linux-s390x 0.15.9
├── esbuild-netbsd-64 0.15.9
├── esbuild-openbsd-64 0.15.9
├── esbuild-sunos-64 0.15.9
├── esbuild-windows-32 0.15.9
├── esbuild-windows-64 0.15.9
└── esbuild-windows-arm64 0.15.9
functionless 0.23.6
├── @aws-cdk/aws-appsync-alpha 2.43.1-alpha.0 peer
├── @functionless/ast-reflection 0.3.2
├── @functionless/nodejs-closure-serializer 0.1.2
├── @swc/cli 0.1.57
├── @swc/core 1.2.245
├── @swc/register 0.1.10
├── @types/aws-lambda 8.10.106
├── aws-cdk-lib 2.43.1 peer
├── aws-sdk 2.1225.0 peer
├── constructs 10.1.116 peer
├── esbuild 0.15.9 peer
├── fs-extra 10.1.0
├── minimatch 5.1.0
├── source-map 0.7.4
├── typesafe-dynamodb 0.2.3 peer
└── typescript 4.8.4 peer
jest 29.1.1
├── @jest/core 29.1.1
├── @jest/types 29.1.0
├── import-local 3.1.0
└── jest-cli 29.1.1
typesafe-dynamodb 0.2.3
├── @aws-sdk/client-dynamodb 3.180.0
├── @aws-sdk/lib-dynamodb 3.180.0
├── @aws-sdk/smithy-client 3.180.0
├── @aws-sdk/types 3.178.0
├── @aws-sdk/util-dynamodb 3.180.0
├── @types/aws-lambda 8.10.106
└── aws-sdk 2.1225.0
typescript 4.8.4

Output of npm ls --depth 1:

[email protected] /home/chris/functionless/new-project
├─┬ @aws-cdk/[email protected]
│ ├── [email protected] deduped
│ └── [email protected] deduped
├─┬ @functionless/[email protected]
│ └── @swc/[email protected]
├─┬ @functionless/[email protected]
│ └── [email protected] deduped invalid: "^0.6.20" from node_modules/@functionless/language-service
├─┬ @types/[email protected]
│ ├── [email protected]
│ └── [email protected]
├── @types/[email protected]
├─┬ [email protected]
│ ├── @balena/[email protected]
│ ├── [email protected]
│ ├── [email protected] deduped
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ └── UNMET OPTIONAL DEPENDENCY [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └── [email protected]
├── [email protected]
├─┬ [email protected]
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/[email protected]
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/[email protected]
│ ├── UNMET OPTIONAL DEPENDENCY [email protected]
│ ├── UNMET OPTIONAL DEPENDENCY [email protected]
│ ├── UNMET OPTIONAL DEPENDENCY [email protected]
│ ├── UNMET OPTIONAL DEPENDENCY [email protected]
│ ├── UNMET OPTIONAL DEPENDENCY [email protected]
│ ├── UNMET OPTIONAL DEPENDENCY [email protected]
│ ├── UNMET OPTIONAL DEPENDENCY [email protected]
│ ├── [email protected]
│ ├── UNMET OPTIONAL DEPENDENCY [email protected]
│ ├── UNMET OPTIONAL DEPENDENCY [email protected]
│ ├── UNMET OPTIONAL DEPENDENCY [email protected]
│ ├── UNMET OPTIONAL DEPENDENCY [email protected]
│ ├── UNMET OPTIONAL DEPENDENCY [email protected]
│ ├── UNMET OPTIONAL DEPENDENCY [email protected]
│ ├── UNMET OPTIONAL DEPENDENCY [email protected]
│ ├── UNMET OPTIONAL DEPENDENCY [email protected]
│ ├── UNMET OPTIONAL DEPENDENCY [email protected]
│ ├── UNMET OPTIONAL DEPENDENCY [email protected]
│ ├── UNMET OPTIONAL DEPENDENCY [email protected]
│ └── UNMET OPTIONAL DEPENDENCY [email protected]
├─┬ [email protected] invalid: "^0.6.20" from node_modules/@functionless/language-service
│ ├── @aws-cdk/[email protected] deduped
│ ├── @functionless/[email protected] deduped
│ ├── @functionless/[email protected]
│ ├── @swc/[email protected]
│ ├── @swc/[email protected]
│ ├── @swc/[email protected]
│ ├── @types/[email protected]
│ ├── [email protected] deduped
│ ├── [email protected] deduped
│ ├── [email protected] deduped
│ ├── [email protected] deduped
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected] deduped invalid: "^0.1.5" from node_modules/functionless
│ └── [email protected] deduped
├─┬ [email protected]
│ ├── @jest/[email protected]
│ ├── @jest/[email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └── UNMET OPTIONAL DEPENDENCY node-notifier@^8.0.1 || ^9.0.0 || ^10.0.0
├─┬ [email protected] invalid: "^0.1.5" from node_modules/functionless
│ ├── @aws-sdk/[email protected]
│ ├── @aws-sdk/[email protected]
│ ├── @aws-sdk/[email protected]
│ ├── @aws-sdk/[email protected]
│ ├── @aws-sdk/[email protected]
│ ├── @types/[email protected] deduped
│ └── [email protected] deduped
└── [email protected]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions