Shopify / slate

Slate is a toolkit for developing Shopify themes. It's designed to assist your workflow and speed up the process of developing, testing, and deploying themes.
https://shopify.github.io/slate
MIT License
1.28k stars 365 forks source link

Yarn start throwing error wrt .env #872

Open ChariseWalraven opened 5 years ago

ChariseWalraven commented 5 years ago

Problem

Yarn start is throwing an error

Replication steps

  1. yarn create slate-theme my-new-theme
  2. cd my-new-theme
  3. yarn && yarn start

More Information

Node -v
v10.7.0

yarn -v
1.12.1

slate
zsh: permission denied: slate

This is what my .env file looks like:

SLATE_STORE=faircotton.myshopify.com

SLATE_PASSWORD={{password}}

SLATE_THEME_ID=43794399294

SLATE_IGNORE_FILES=config/settings_data.json

This is the error message:

✔  Compiled successfully in 2.912s!
Some values in environment 'default' are invalid:
- Error: SLATE_STORE must be a valid .myshopify.com URL
- Error: SLATE_PASSWORD can only contain numbers and letters
- Error: SLATE_THEME_ID can be set to 'live' or a valid theme ID containing only numbers
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
huguestennier commented 5 years ago

Unable to reproduce with the exact same setup, but i'm able to reproduce some errors if I rename my .env file to something else like .envtest.

Make sure your .env file is named properly and that it sits at the top level of your site

ChariseWalraven commented 5 years ago

Hi @huguestennier! Thanks for the suggestion, however it is in the root and it is named .env

jakekapitz commented 5 years ago

I've received the same error in the last few days also, though in slightly different circumstances. I have both.env.production and .env.development in the project root, hitting yarn start throws the invalid error. It all works perfectly fine if I remove the ".development" or ".production".

jonas-davidson commented 5 years ago

I've receiving this same error @ChariseWalraven . Any solutions since your original post? I've searched everywhere but no luck.

alishagarric commented 5 years ago

If you have a .env file that is specific to development or production you have to specify that in your command. So instead of just doing yarn start do yarn start --env=development or whatever yours is

ThaoD5 commented 4 years ago

I am encountering the exact same issue, tried :

Same formatting in my .env file than OP and can't find any solution to this so far

ThaoD5 commented 4 years ago

Somehow managed to get rid of this issue by rebooting. I tried those manipulation after having installed mkcert to work with Slate "locally", and I guess something went wrong at some point, so if someone encounters a similar issue, give your computer a reboot, might fix the issue ( strangely )