-
Notifications
You must be signed in to change notification settings - Fork 50
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
Unable to use modules from package set #222
Comments
Here's something I found. Notice how the I'm assuming that's the source of the issue here? |
That’s definitely curious. I suspect it would be worth looking back through the history because I’m fairly certain they were used at one point. |
I'm pretty sure this would have happened in #209. |
Yes, looks like it. Specifically: 0427198 |
Edit: client, not trypurescript, server. When I copy-paste the code we had originally in the commit linked above, the console of the
|
So, copy-pasting the original code in the commit linked above and doing one other step (as a temporary fix below) seems to fix the issue. The above requests are being made because the returned JavaScript has "use strict";
var Data_Foldable = require("../Data.Foldable/index.js"); which will then ping the So, put differently, why was the code transition to the |
Ah right, I remember now - we transitioned to use |
This isn't just the development environment by the way, this problem would also surface in production. This is a must-fix before our next deploy, I think. |
The current implementation seems to assume that we'll use So, I think we need to make the following changes. This doesn't completely fix the problem because the require statements above are asking the client server (i.e. e <- runExceptT $ do
modules <- ExceptT $ I.loadAllModules inputFiles
- (exts, env) <- ExceptT . I.runMake . I.make $ map (second CST.pureResult) modules
- namesEnv <- fmap fst . runWriterT $ foldM P.externsEnv P.primEnv exts
+ ExceptT . I.runMake . I.make $ map (second CST.pureResult) modules
- pure (exts, namesEnv, env)
case e of
Left err -> print err >> exitFailure
- Right (exts, namesEnv, env) -> server exts namesEnv env port
+ Right (exts, env) -> server exts env port - server :: [P.ExternsFile] -> P.Env -> P.Environment -> Int -> IO ()
- server externs initNamesEnv initEnv port = do
+ server :: [P.ExternsFile] -> P.Environment -> Int -> IO ()
+ server externs initEnv port = do - (makeResult, warnings) <- Make.runMake P.defaultOptions $ Make.rebuildModule makeActions [] m
+ (makeResult, warnings) <- Make.runMake P.defaultOptions $ Make.rebuildModule makeActions externs m |
While #220 made the server work, the larger goal was to make this entire project work in a local setting. So, this issue seeks to fix that problem.
The current issue, explained by Thomas here, is that modules aren't known when we attempt to compile code that uses them.
The text was updated successfully, but these errors were encountered: