Skip to content
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

Loading package outside of main module when precompiling could have better error message #45832

Closed
fredrikekre opened this issue Jun 27, 2022 · 1 comment · Fixed by #51635
Closed
Labels
error handling Handling of exceptions by Julia or the user

Comments

@fredrikekre
Copy link
Member

Brought up on Zulip; the following package code:

$ cat src/TestPackage.jl
using Example

module TestPackage

end # module

gives a rather bizarre error:

$ julia -e 'using TestPackage'
ERROR: LoadError: ArgumentError: Package Base does not have Example in its dependencies:
- You may have a partially installed environment. Try `Pkg.instantiate()`
  to ensure all packages in the environment are installed.
- Or, if you have Base checked out for development and have
  added Example as a dependency but haven't updated your primary
  environment's manifest file, try `Pkg.resolve()`.
- Otherwise you may need to report an issue with Base
Stacktrace:

Perhaps code outside the main module should be ignored altogether, or have a descriptive error? In any case, the error message above should be improved.

@fredrikekre fredrikekre added the error handling Handling of exceptions by Julia or the user label Jun 27, 2022
@DilumAluthge
Copy link
Member

At the very least, printing the line number of the bad using/import statement would help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error handling Handling of exceptions by Julia or the user
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants