kcl-lang / kcl

KCL Programming Language (CNCF Sandbox Project). https://kcl-lang.io
https://kcl-lang.io
Apache License 2.0
1.7k stars 119 forks source link

I added template.render.ingress.app import, and kcl run reported an error. If not, the ide plug-in reported an error. #1620

Open riven-blade opened 2 months ago

riven-blade commented 2 months ago

General Question

Hello

image

ide plug-in error

failed to compile the kcl package
error[E2F04]: CannotFindModule
 --> /Users/doudou/Desktop/hose-ops/saas-kcl/resources/ingress/base/base.k:1:1
  |
1 | import template.render.ingress.app
  | ^ the `template.render.ingress.app` is found multiple times in the current package and vendor package
He1pa commented 2 months ago

do you have defined kcl.mod ?

riven-blade commented 2 months ago

Yes, But I have no definition in the base directory. The base directory also requires a mod file. It seems that I have a configuration that does not define a mod file. It can, but this one cannot, which is very strange.

He1pa commented 2 months ago

Can you provide the complete code, or the directory structure and code snippets? The compilation error message may be that there is a pkg with the same name in kcl.mod and locally, and they conflict.