windmill icon indicating copy to clipboard operation
windmill copied to clipboard

bug: absolute import used in flow cannot be used for autocomplete

Open ImSingee opened this issue 1 year ago • 5 comments

Describe the bug

When using import {} from "/f/xx/xx.ts", the autocomplete features won't work.

To reproduce

  1. Create a script /f/test/test.ts
  2. Create a flow, create a new inline bun script, write import {} from "/f/test/test.ts"
  3. The editor will show Cannot find module '/f/test/test.ts' or its corresponding type declarations.(2307)

Expected behavior

The editor shouldn't report any errors

Screenshots

image

Browser information

Arc Version 1.47.1 (50893) Chromium Engine Version 126.0.6478.57

Application version

Cloud Version (EE v1.349.0-3-ga82184beb)

Additional Context

In the console, the editor downloads the script successfully: image

The bug is only for the editor. The script can be executed successfully.

The bug is only for flow; it doesn't exist in the script.

I create a dedicated windmill cloud workspace for this bug report, you can view and test it directly in bryan-test workspace.

ImSingee avatar Jun 20 '24 06:06 ImSingee

And same for deno

image

ImSingee avatar Jun 20 '24 06:06 ImSingee

And everything works well when using relative imports: image

But not if using relative imports in branch: image

ImSingee avatar Jun 20 '24 06:06 ImSingee

This is the exported file for my test workspace:

windmill-bryan-test.zip

ImSingee avatar Jun 20 '24 06:06 ImSingee

Yeah import path typing needs to be fixed, just spent hours trying different workaround but none is working so I'm just going to stick to absolute path for now

whollacsek avatar Jun 21 '24 13:06 whollacsek

We likely cannot make work the absolute imports in the editor but all the other issues should be fixed on latest. Thanks for the report. I strongly recommend using only relative imports, absolute imports are too hacky imho, and should only be used as an escape hatch (and the issues here being solved, that's one less reason to not use them)

rubenfiszel avatar Jun 21 '24 16:06 rubenfiszel