Errors when accessing docs or metas with no cache
otherjoel opened this issue · comments
I am seeing some errors I did not expect when using get-doc
and get-metas
on documents that aren't yet cached. Here are steps to recreate the problem:
- Create a new empty folder
- Create a
pollen.rkt
consisting of only one line,#lang racket
- Create an
example.html.pm
consisting of some token Pollen markup, e.g.:
#lang pollen
◊h1{Example title}
◊p{Hello world}
- In DrRacket, create a new file,
sandbox.rkt
in the same folder. Save the file with these contents:
#lang racket
(require pollen/core)
- With DrRacket open to this
sandbox.rkt
file, click Run, then at the REPL, enter(get-metas 'example.html)
(orget-doc
)
Upon doing this, I receive an error:
../../../../../Applications/Racket v6.12/share/pkgs/errortrace-lib/errortrace/errortrace-lib.rkt:256:58: require: namespace mismatch;
reference to a module that is not available
reference phase: 0
referenced module: "/Applications/Racket v6.12/share/pkgs/errortrace-lib/errortrace/errortrace-key.rkt"
referenced phase level: 0
compilation context...: in: errortrace-key
- At the command line, from within the project folder, do
raco pollen render example.html
, which should complete without problems. - If at this point I re-do step 5 above, it works with no errors.
- If I do
raco pollen reset
, then do step 5 above (clicking Run again to restart the REPL), I again get the error.
I should expect to be able to use get-doc
and get-metas
no matter what the state of the cache is, correct?
This is with Pollen version 2.0.2038.749 on Racket 6.12 on macOS 10.14.3.
Hmm, I can't reproduce this (on Racket 7.1). The msg is coming from errortrace
, which is weird. Have you tried doing raco setup errortrace-lib
?
$ raco setup errortrace-lib
collection-path: collection not found
collection: "errortrace-lib"
in collection directories:
/Users/joel/Library/Racket/6.12/collects
/Applications/Racket v6.12/collects
... [185 additional linked and package directories]
$ raco pkg show --all | grep errortrace
errortrace* e63c664f79bb0... catalog...rtrace
errortrace-doc* 104c0b4b878fa... catalog...ce-doc
errortrace-lib* f7873118981ce... catalog...ce-lib
Maybe raco setup errortrace
? Sorry for the human experimentation. Usually the message "reference to a module that is not available" indicates out-of-date compiled files.
raco setup errortrace
worked fine but did not affect the problem.
Then I went a little overboard and did raco setup --clean
followed by raco setup
— still did not fix the problem.
Then I installed Racket 7.2, then installed pollen from within the 7.2 DrRacket (user scope). The problem does not occur with 7.2
Finally I deleted my 6.12 installation, downloaded and reinstalled 6.12 fresh from the Racket website, and reinstalled pollen (user scope). The problem does reoccur in this situation.
OK, thanks for the detail. I'll look into this shortly on 6.12.
Changing that setting does seem to fix the problem in 6.12 DrRacket.
Also, interestingly, I can no longer reproduce the problem in the CLI REPL for 6.12 (by just running racket
at the prompt). I did encounter it there too at least once, but that was in the context of my original project, before I created the MVE and opened this issue.
So given that you can't reproduce it, it seems likely the problem is/was on my end, and not a problem in Pollen at any rate.