eeue56 / elm-static-html-lib

BSD 3-Clause "New" or "Revised" License
57 stars 11 forks source link

Problems with non elm-lang packages #3

Closed mclaren212 closed 6 years ago

mclaren212 commented 6 years ago

Hi, I've been using elm-static-html-lib to generate html using elm code almost exactly how you do in your example. I use node to run a javascript file which calls the elmStaticLib function, giving my elm module's model, json decoder and view as arguments.

Up until today, I was getting an error when running the js, saying that one of the packages I was using couldn't be found. I analyzed the elmStaticHtml function and found that it was creating a new directory, .elm-static-html, and also creating a new elm-package.json file and elm-stuff directory based off of my project's elm-package.json. I looked in that elm-stuff folder, and found out that any package which isn't under elm-lang (core, html) wasn't actually in the directory, even though it is referenced in the new elm-package.json file, which is why the error was occurring. I deleted that elm-stuff folder and ran elm-package install inside of .elm-static-html, which installed everything correctly and got rid of the error message.

However, I now notice problems with the way my view is rendered, and I suspect it is because elm-static-html-lib doesn't handle the two non elm-lang packages I'm using, style-elements and elm-exts, properly. I wanted to know if you were aware of problems with using non elm-lang packages with elm-static-html-lib, and if so, is there a way to fix them? I also wanted to bring your attention to the fact that non elm-lang packages aren't installed when generating .elm-static-html's elm-stuff folder. thanks.

eeue56 commented 6 years ago

Up until today, I was getting an error when running the js, saying that one of the packages I was using couldn't be found. I analyzed the elmStaticHtml function and found that it was creating a new directory, .elm-static-html, and also creating a new elm-package.json file and elm-stuff directory based off of my project's elm-package.json. I looked in that elm-stuff folder, and found out that any package which isn't under elm-lang (core, html) wasn't actually in the directory, even though it is referenced in the new elm-package.json file, which is why the error was occurring. I deleted that elm-stuff folder and ran elm-package install inside of .elm-static-html, which installed everything correctly and got rid of the error message.

What happens if you delete that folder, then run elm-static-html-lib? Does it install the packages correctly? Can you create a minimal example with that elm-package.json and a rendered view the way you have it set up?

However, I now notice problems with the way my view is rendered, and I suspect it is because elm-static-html-lib doesn't handle the two non elm-lang packages I'm using, style-elements and elm-exts, properly. I wanted to know if you were aware of problems with using non elm-lang packages with elm-static-html-lib, and if so, is there a way to fix them? I also wanted to bring your attention to the fact that non elm-lang packages aren't installed when generating .elm-static-html's elm-stuff folder. thanks.

Third party packages work fine and have been working fine for me, so it's likely something else to blame.

mclaren212 commented 6 years ago

What happens if you delete that folder, then run elm-static-html-lib? Does it install the packages correctly?

Yeah, I just tried this and everything installed correctly. I wondered why that was and hypothesized it was due to running elm-static-html-lib before I installed the other packages, then running it again after installing new packages; I tested that out and I got the same error, so that was why it was happening. Do you still want me to create the example?

Third party packages work fine and have been working fine for me, so it's likely something else to blame.

Hmm ok, I'll do some more investigation into what is going on.

eeue56 commented 6 years ago

Yeah, I just tried this and everything installed correctly. I wondered why that was and hypothesized it was due to running elm-static-html-lib before I installed the other packages, then running it again after installing new packages; I tested that out and I got the same error, so that was why it was happening. Do you still want me to create the example?

yep,I can't check what's happening with out an example

mclaren212 commented 6 years ago

ok, i created a repository and sent an invitation to you

eeue56 commented 6 years ago

Closing and opening a new issue to reflect the actual issue

eeue56 commented 6 years ago

This is the new one: https://github.com/eeue56/elm-static-html-lib/issues/4