Stream: beginners

Topic: Internal package imports fail in tarball package?


view this post on Zulip Ian McLerran (Apr 26 2024 at 19:56):

So I just tried publishing a package on Github via hashed tarball. I tried importing the package via Roc's package downloading functionality, but it seems every expect statement used in my package internals is throwing a MODULE NOT IMPORTED error.

IE: ── MODULE NOT IMPORTED in ...nv2LpABZzVYHlata79rpfaF_bJaxsbYMLtk-mF_w/Time.roc ─

What did I do wrong here?

view this post on Zulip Luke Boswell (Apr 26 2024 at 20:13):

Im not sure, I haven't seen that before.

I use @Hannes Github Action which has been working nicely https://github.com/Hasnep/bundle-roc-library

view this post on Zulip Luke Boswell (Apr 26 2024 at 20:14):

Which module is it saying isn't imported?

view this post on Zulip Luke Boswell (Apr 26 2024 at 20:15):

How did you make the hashed tarball? Did you use roc build --bundle .tar.br package/main.roc?

view this post on Zulip Ian McLerran (Apr 26 2024 at 20:17):

I also used Hannes' hasnep/bundle-roc-library

view this post on Zulip Ian McLerran (Apr 26 2024 at 20:17):

Which module is it saying isn't imported?

Pretty much all of them lol

view this post on Zulip Ian McLerran (Apr 26 2024 at 20:17):

I've got 111 errors I believe, and they're all pretty much the same, but various Modules in various locations. All at expect statements.

view this post on Zulip Ian McLerran (Apr 26 2024 at 20:24):

── MODULE NOT IMPORTED in ...nv2LpABZzVYHlata79rpfaF_bJaxsbYMLtk-mF_w/Time.roc ─
The `UtcTime` module is not imported:

350│  expect toUtcTime { hour: 12, minute: 34, second: 56, nanosecond: 5 } == UtcTime.fromNanosSinceMidnight (12 * nanosPerHour + 34 * nanosPerMinute + 56 * nanosPerSecond + 5 )
                                                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Did you mean to import it?
───────────────────────────────────────────────────
111 errors and 3 warnings found in 51 ms

view this post on Zulip Ian McLerran (Apr 26 2024 at 23:23):

I was really hoping this was just a case of obvious PEBCAK! :sweat_smile:

view this post on Zulip Ian McLerran (Apr 27 2024 at 01:02):

QQ: Anyone know where the default download directory is for packages roc downloads from a url?

view this post on Zulip Agus Zubiaga (Apr 27 2024 at 01:18):

This is likely caused by #5477, which will be fixed when #6658 lands.

For now, you can try importing the modules in your app even if you don’t use them directly.

view this post on Zulip Agus Zubiaga (Apr 27 2024 at 01:19):

The example in the issue involves two packages, but it can happen with only one package

view this post on Zulip Brendan Hansknecht (Apr 27 2024 at 04:11):

QQ: Anyone know where the default download directory is for packages roc downloads from a url?

~/.cache/roc/packages/

view this post on Zulip Ian McLerran (Apr 27 2024 at 05:31):

Awesome, thanks @Agus Zubiaga and @Brendan Hansknecht!


Last updated: Jul 06 2025 at 12:14 UTC