-
Notifications
You must be signed in to change notification settings - Fork 55
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
Classes imported from shards throw a "undefined constant" error #194
Comments
This is probably due to the wrong main file being set. Some fixes should be coming soon but in the meantime can you post the contents of the crystal output channel when this happens, and your projects file structure? |
Output
File Structure
Not that all the errors I get are from classes I inherit from. class CorsHandler < Kemal::Handler
end
class CreateTasks < Jennifer::Migration::Base
end
class User < Jennifer::Model::Base
end |
As you're using Crystalline, the issue either lies with that or with how you've set it up. Do these errors still come up when the LSP is disabled? |
I don't get those errors when disabling Crystalline but then I'm back to this issue #185 |
When using crystalline, try setting an entrypoint using the process described here |
Describe the bug
I have a small api that uses the
jennifer
ORMThe shard is required from it's initializer file
Which itself is imported by the config file
But in my
Task
model I get an error saying theJennifer::Model::Base
class is undefinedThe code works though as tests passes
This is true for any class coming from an installed shard which is not required in the file it's being used as far as I can tell
To Reproduce
Create a directory, install shard, require it in a config file and use it from a file that requires the config file
Expected behavior
It shouldn't throw an error
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: