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

[Bug Report]: v2 use unplugin-vue-compents custom resolver thread error #2053

Open
ErKeLost opened this issue Jan 9, 2025 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@ErKeLost
Copy link
Member

ErKeLost commented Jan 9, 2025

Steps to reproduce

vue example add unplugin-vue-components plugins use custom resolver error

import path from 'node:path'
import Vue from 'unplugin-vue/farm'
import { VantResolver } from 'unplugin-vue-components/resolvers'
import Components from 'unplugin-vue-components/farm'

const config = {
  plugins: [
    Vue({
      include: [/\.vue$/, /\.md$/],
    }),
    Components({
      extensions: ['vue', 'md', 'svg'],
      directoryAsNamespace: true,
      dts: true,
      globalNamespaces: ['global'],
      include: [/\.vue($|\?)/, /\.md($|\?)/],
      resolvers: [
        (name) => {
          if (name === 'MyCustom')
            return path.resolve(__dirname, 'src/CustomResolved.vue').replaceAll('\\', '/')
        },
        VantResolver(),
      ],
    }),
  ],
}
  • get error
> [email protected] dev /Users/adny/typescript/unplugin-vue-components/examples/farm-vue3
> farm dev

thread '<unnamed>' panicked at crates/node/src/plugin_adapters/js_plugin_adapter/context.rs:245:6:
Argument 0 should be a string when calling error: Error { status: InvalidArg, reason: "invalid type: map, expected a string", maybe_raw: 0x0 }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at core/src/panicking.rs:221:5:
panic in a function that cannot unwind
stack backtrace:
   0:        0x12d467ee4 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h3516d3727e4fe664
   1:        0x12d489778 - core::fmt::write::h3cf25e6890d6884f
   2:        0x12d464240 - std::io::Write::write_fmt::h371ae990c0f80aae
   3:        0x12d467d98 - std::sys::backtrace::BacktraceLock::print::h6e94cfd2d824d621
   4:        0x12d468cc0 - std::panicking::default_hook::{{closure}}::h08f2daea39d90bc3
   5:        0x12d468b04 - std::panicking::default_hook::he290e37d54206f0f
   6:        0x12d469474 - std::panicking::rust_panic_with_hook::he9e7a691abc6490c
   7:        0x12d469100 - std::panicking::begin_panic_handler::{{closure}}::h76e8e9b8127ee308
   8:        0x12d4683a8 - std::sys::backtrace::__rust_end_short_backtrace::h96d8ed392cde8e6b
   9:        0x12d468de0 - _rust_begin_unwind
  10:        0x12d54c758 - core::panicking::panic_nounwind_fmt::h54d719431190a0b7
  11:        0x12d54c7d0 - core::panicking::panic_nounwind::haff73e8f1609db96
  12:        0x12d54c8bc - core::panicking::panic_cannot_unwind::h9e5a31d7b1180074
  13:        0x12b8eb854 - farmfe_node::plugin_adapters::js_plugin_adapter::context::error::hc9737197242d7928
thread caused non-unwinding panic. aborting.
 ELIFECYCLE  Command failed.
[1]    67710 abort      pnpm dev

Reproduce link

No response

What is actually happening?

  • config
image
  • usage
image

System Info

mac
@ErKeLost ErKeLost added the bug Something isn't working label Jan 9, 2025
@ErKeLost ErKeLost self-assigned this Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant