plotly / dash-component-boilerplate

Get started creating your own Dash components here.
265 stars 182 forks source link

Problem with reserved word pattern #160

Closed khuesmann closed 5 months ago

khuesmann commented 5 months ago

Hi,

I am facing a problem with reserved word patterns when trying to build my project. I am using WASM and extended the webpack.config.js by a WasmPackPlugin.

When i watch, everything works fine.

But as soon as I try to build (or build:backends), I get this error

ERROR: "__@iterator@69" matches reserved word pattern: /^_.*$/
extract-meta failed

I am not sure where this emerges from. In my project code, I am not using this pattern (low-dash) in my names. The built Rust code on the other hand creates names like for example this

export function __wbg_set_wasm(val) {
    wasm = val;
}

Is this the problem? I can not find a parameter to ignore these reserved word patterns. Is there any way to get this working? Thank you in advance

T4rk1n commented 5 months ago

This is coming from the dash component builder, it expect all files in the components to match the component naming criteria.

You can put the external code in a parent folder and import it from there in your components.

khuesmann commented 5 months ago

@T4rk1n thank you for the quick reply. In my components folder, I only have a single component called PPC.tsx, and this is the only variable that is exported in this file.

khuesmann commented 5 months ago

@T4rk1n thanks again for your help. You gave me the right hint. I was using a type that was defined like this

type SelectedColor = {
    scale: string | Color | ColorScale,
    color: number | string | { type: "probability" }
}

Here, the color attribute has a weird type { type: "probability" }. When fixing this to a proper type, the error was gone.

This ticket can be closed!