TranscryptOrg / Transcrypt

Python 3.9 to JavaScript compiler - Lean, fast, open!
https://www.transcrypt.org
Apache License 2.0
2.82k stars 215 forks source link

Compile error when importing a long (path and class) name #852

Closed chopin closed 1 year ago

chopin commented 1 year ago
from game.frontend.ui3d.stackPanel3dUsingButtonBillboard import StackPanel3dUsingButtonBillboard4table3d

Compile Error: Cannot find the file from  any of ... 

I changed the file name and the class name shorter, and the error disappeared.

import game.frontend.ui3d.stackPanelEmul3d import StackPanelEmul3d4table3d

The Python itself may have limit on length of class (, variable, or path) names. However, we are using pretty long names in modern day programming. Naming is very very important as program code becoming more complicated in OOP.

I hope that longer naming is supported, or a clear error message is printed showing the cause of error is the length of name. I wasted more than 6 hours to find the cause of this error. The error message was just showing "Cannot find the file..."

Thanks..

JennaSys commented 1 year ago

This might be related to another issue. Can you post the full error message/stack trace?

chopin commented 1 year ago

I tried to reproduce the error, but the error was not shown with a long name anymore . It seems that the error was not because of a long name, but related to something else. I will add a comment if I encounter the error again.