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

fix: lit tempalate ts error (0.4) #450

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

c12i
Copy link
Collaborator

@c12i c12i commented Jan 20, 2025

This PR fixes a ts error preventing vite build from running successfully for lit templates

https://github.com/holochain/scaffolding/actions/runs/12763486851/job/35573852491#step:6:1006

@c12i c12i changed the title fix: lit tempalate ts error fix: lit tempalate ts error (0.4) Jan 20, 2025
@c12i c12i mentioned this pull request Jan 20, 2025
7 tasks
@c12i c12i requested a review from a team January 20, 2025 18:13
Copy link

@jost-s jost-s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's building again.

How did this error happen in the first place?

@c12i c12i merged commit 47553d7 into develop-0.4 Jan 20, 2025
11 checks passed
@c12i c12i deleted the fix/fix-lit-template-build-failure-0.4 branch January 20, 2025 18:20
@pdaoust
Copy link
Collaborator

pdaoust commented Jan 20, 2025

uh-oh... I came late to the game (took forever to enter the developer shell from the flake in this repo). I discovered that it no longer throws compilation errors after scaffolding an entry type, but it's still doing it for collections.

Scaffolding a collection, either global or by-author, throws this error + gnarly backtrace:

thread 'main' panicked at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/context.rs:196:7:
Debug Panic Expected text `]`, but found `y`
stack backtrace:
   0: rust_begin_unwind
             at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/std/src/panicking.rs:652:5
   1: core::panicking::panic_fmt
             at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/core/src/panicking.rs:72:14
   2: dprint_plugin_typescript::generation::context::Context::assert_text
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/context.rs:196:7
   3: dprint_plugin_typescript::generation::generate::gen_surrounded_by_tokens
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:9294:5
   4: dprint_plugin_typescript::generation::generate::gen_array_like_nodes
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:6874:16
   5: dprint_plugin_typescript::generation::generate::gen_array_pat
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:4227:16
   6: dprint_plugin_typescript::generation::generate::gen_node_with_inner_gen::gen_node_inner
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:258:31
   7: dprint_plugin_typescript::generation::generate::gen_node_with_inner_gen
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:108:28
   8: dprint_plugin_typescript::generation::generate::gen_node_with_separator
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:7777:18
   9: dprint_plugin_typescript::generation::generate::gen_separated_values_with_result::{{closure}}
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:7684:45
  10: dprint_core::formatting::ir_helpers::gen_separated_values::gen_separated_values
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-core-0.66.2/src/formatting/ir_helpers/gen_separated_values.rs:209:26
  11: dprint_plugin_typescript::generation::generate::gen_separated_values_with_result
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:7648:3
  12: dprint_plugin_typescript::generation::generate::gen_separated_values
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:7632:3
  13: dprint_plugin_typescript::generation::generate::gen_parameters_or_arguments::{{closure}}
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:7355:22
  14: dprint_plugin_typescript::generation::generate::gen_surrounded_by_tokens
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:9317:20
  15: dprint_plugin_typescript::generation::generate::gen_parameters_or_arguments
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:7325:10
  16: dprint_plugin_typescript::generation::generate::gen_arrow_func_expr::gen_arrow_signature
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:1755:22
  17: dprint_plugin_typescript::generation::generate::gen_arrow_func_expr::gen_inner_arrow
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:1663:45
  18: dprint_plugin_typescript::generation::generate::gen_arrow_func_expr::gen_inner
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:1588:7
  19: dprint_plugin_typescript::generation::generate::gen_arrow_func_expr
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:1576:15
  20: dprint_plugin_typescript::generation::generate::gen_node_with_inner_gen::gen_node_inner
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:179:32
  21: dprint_plugin_typescript::generation::generate::gen_node_with_inner_gen
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:108:28
  22: dprint_plugin_typescript::generation::generate::gen_node
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:50:3
  23: dprint_plugin_typescript::generation::generate::gen_expr_or_spread
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:2580:16
  24: dprint_plugin_typescript::generation::generate::gen_node_with_inner_gen::gen_node_inner
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:188:35
  25: dprint_plugin_typescript::generation::generate::gen_node_with_inner_gen
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:108:28
  26: dprint_plugin_typescript::generation::generate::gen_node_with_separator
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:7777:18
  27: dprint_plugin_typescript::generation::generate::gen_separated_values_with_result::{{closure}}
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:7684:45
  28: dprint_core::formatting::ir_helpers::gen_separated_values::gen_separated_values
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-core-0.66.2/src/formatting/ir_helpers/gen_separated_values.rs:209:26
  29: dprint_plugin_typescript::generation::generate::gen_separated_values_with_result
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:7648:3
  30: dprint_plugin_typescript::generation::generate::gen_separated_values
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:7632:3
  31: dprint_plugin_typescript::generation::generate::gen_parameters_or_arguments::{{closure}}
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:7355:22
  32: dprint_plugin_typescript::generation::generate::gen_surrounded_by_tokens
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:9317:20
  33: dprint_plugin_typescript::generation::generate::gen_parameters_or_arguments
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:7325:10
  34: dprint_plugin_typescript::generation::generate::gen_new_expr
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:2735:16
  35: dprint_plugin_typescript::generation::generate::gen_node_with_inner_gen::gen_node_inner
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:196:30
  36: dprint_plugin_typescript::generation::generate::gen_node_with_inner_gen
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:108:28
  37: dprint_plugin_typescript::generation::generate::gen_node
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:50:3
  38: dprint_plugin_typescript::generation::generate::gen_assignment_like_with_token
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:9180:22
  39: dprint_plugin_typescript::generation::generate::gen_assignment_op_to
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:9147:3
  40: dprint_plugin_typescript::generation::generate::gen_assignment
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:9138:3
  41: dprint_plugin_typescript::generation::generate::gen_class_prop_common
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:675:18
  42: dprint_plugin_typescript::generation::generate::gen_class_prop
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:510:3
  43: dprint_plugin_typescript::generation::generate::gen_node_with_inner_gen::gen_node_inner
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:143:32
  44: dprint_plugin_typescript::generation::generate::gen_node_with_inner_gen
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:108:28
  45: dprint_plugin_typescript::generation::generate::gen_node
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:50:3
  46: dprint_plugin_typescript::generation::generate::gen_members
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:7234:9
  47: dprint_plugin_typescript::generation::generate::gen_membered_body::{{closure}}
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:6981:7
  48: dprint_plugin_typescript::generation::generate::gen_block::{{closure}}
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:9235:44
  49: dprint_plugin_typescript::generation::generate::gen_surrounded_by_tokens
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:9317:20
  50: dprint_plugin_typescript::generation::generate::gen_block
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:9221:16
  51: dprint_plugin_typescript::generation::generate::gen_membered_body
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:6979:16
  52: dprint_plugin_typescript::generation::generate::gen_class_decl_or_expr::{{closure}}
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:917:7
  53: dprint_plugin_typescript::generation::context::Context::with_maybe_consistent_props
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/context.rs:180:7
  54: dprint_plugin_typescript::generation::generate::gen_class_decl_or_expr
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:913:16
  55: dprint_plugin_typescript::generation::generate::gen_class_decl
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:812:3
  56: dprint_plugin_typescript::generation::generate::gen_node_with_inner_gen::gen_node_inner
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:160:32
  57: dprint_plugin_typescript::generation::generate::gen_node_with_inner_gen
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:108:28
  58: dprint_plugin_typescript::generation::generate::gen_node
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:50:3
  59: dprint_plugin_typescript::generation::generate::gen_export_decl
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:955:16
  60: dprint_plugin_typescript::generation::generate::gen_node_with_inner_gen::gen_node_inner
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:161:33
  61: dprint_plugin_typescript::generation::generate::gen_node_with_inner_gen
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:108:28
  62: dprint_plugin_typescript::generation::generate::gen_node
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:50:3
  63: dprint_plugin_typescript::generation::generate::gen_statements
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:7046:22
  64: dprint_plugin_typescript::generation::generate::gen_program
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:4218:16
  65: dprint_plugin_typescript::generation::generate::gen_module
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:4174:3
  66: dprint_plugin_typescript::generation::generate::gen_node_with_inner_gen::gen_node_inner
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:255:29
  67: dprint_plugin_typescript::generation::generate::gen_node_with_inner_gen
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:108:28
  68: dprint_plugin_typescript::generation::generate::gen_node
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:50:3
  69: dprint_plugin_typescript::generation::generate::generate::{{closure}}
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:35:21
  70: dprint_swc_ext::view::generated::with_ast_view::{{closure}}
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-swc-ext-0.20.0/src/view/generated.rs:26:19
  71: dprint_swc_ext::view::generated::with_ast_view_for_module::{{closure}}
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-swc-ext-0.20.0/src/view/generated.rs:54:18
  72: std::thread::local::LocalKey<T>::try_with
             at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/std/src/thread/local.rs:283:12
  73: std::thread::local::LocalKey<T>::with
             at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/std/src/thread/local.rs:260:9
  74: dprint_swc_ext::view::generated::with_ast_view_for_module
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-swc-ext-0.20.0/src/view/generated.rs:40:3
  75: dprint_swc_ext::view::generated::with_ast_view
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-swc-ext-0.20.0/src/view/generated.rs:21:7
  76: deno_ast::parsed_source::ParsedSource::with_view
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/deno_ast-0.42.2/src/parsed_source.rs:312:5
  77: dprint_plugin_typescript::generation::generate::generate
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/generation/generate.rs:32:3
  78: dprint_plugin_typescript::format_text::inner_format::{{closure}}
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/format_text.rs:77:25
  79: dprint_core::formatting::print::format
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-core-0.66.2/src/formatting/print.rs:38:21
  80: dprint_plugin_typescript::format_text::inner_format
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/format_text.rs:74:16
  81: dprint_plugin_typescript::format_text::format_text
             at /home/paul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-typescript-0.91.8/src/format_text.rs:50:11
  82: holochain_scaffolding_cli::utils::format_code
             at /home/paul/Holochain/scaffolding/src/utils.rs:308:38
  83: holochain_scaffolding_cli::templates::render_template_file_tree::{{closure}}
             at /home/paul/Holochain/scaffolding/src/templates.rs:166:44
  84: core::option::Option<T>::map_or
             at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/core/src/option.rs:1134:24
  85: holochain_scaffolding_cli::templates::render_template_file_tree
             at /home/paul/Holochain/scaffolding/src/templates.rs:149:17
  86: holochain_scaffolding_cli::templates::render_template_file_tree_and_merge_with_existing
             at /home/paul/Holochain/scaffolding/src/templates.rs:290:9
  87: holochain_scaffolding_cli::templates::collection::scaffold_collection_templates
             at /home/paul/Holochain/scaffolding/src/templates/collection.rs:74:25
  88: holochain_scaffolding_cli::scaffold::collection::scaffold_collection
             at /home/paul/Holochain/scaffolding/src/scaffold/collection.rs:136:5
  89: holochain_scaffolding_cli::cli::collection::Collection::run
             at /home/paul/Holochain/scaffolding/src/cli/collection.rs:74:13
  90: holochain_scaffolding_cli::cli::HcScaffold::run::{{closure}}
             at /home/paul/Holochain/scaffolding/src/cli.rs:61:58
  91: hc_scaffold::main::{{closure}}
             at /home/paul/Holochain/scaffolding/src/bin/hc-scaffold.rs:7:51

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

Successfully merging this pull request may close these issues.

3 participants