elm-styled icon indicating copy to clipboard operation
elm-styled copied to clipboard

Cannot compile project when Styled is imported

Open hissfield opened this issue 7 years ago • 1 comments

Hi! Thank you for your work! I am new to Elm, so excuse me if I'm asking something obvious. I've installed elm-styled directly from github with yarn. I added its path to source-directories in elm-package.json.

When I try to use it I get this error:

Module build failed: Error: Compiler process exited with error Compilation failed
I cannot find module 'Native.Css'.

Module 'Styled' is trying to import it.

Do you maybe have an example project setup somewhere with elm-styled that I can copy? Thanks!

hissfield avatar Sep 16 '17 06:09 hissfield

@hissfield This is a tricky process that requires a few steps if you really want to get in the weeds. I was able to get this working myself so that is why I am passing on the info.

First, you will need to git clone this repo and also elm-ops-tooling

What I did was cloned elm-ops-tooling into a script folder and this repo inside a vendor folder.

Next do elm package install Skinney/murmur3 since it is a dependency of this repo.

Lastly run this command in the same directory as your elm-package.json: python scripts/elm-ops-tooling/elm_self_publish.py vendor/elm-styled ./

This is a python script that will self-publish elm-styled and put it as part of your elm-package.json and also in your elm-stuff.

Lastly, after feelings of guilt have subsided for publishing a native module, try out elm-styled in your Elm project!

arecvlohe avatar Sep 23 '17 04:09 arecvlohe