slate icon indicating copy to clipboard operation
slate copied to clipboard

Yarn start throwing error wrt .env

Open ChariseWalraven opened this issue 6 years ago • 7 comments

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.

ChariseWalraven avatar Nov 13 '18 15:11 ChariseWalraven

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

huguestennier avatar Nov 14 '18 14:11 huguestennier

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

ChariseWalraven avatar Nov 15 '18 06:11 ChariseWalraven

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".

jakekapitz avatar Nov 17 '18 11:11 jakekapitz

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

jonas-davidson avatar Mar 27 '19 21:03 jonas-davidson

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

alishagarric avatar Sep 24 '19 03:09 alishagarric

I am encountering the exact same issue, tried :

  • default .env file, ran yarn start
  • custom .env.development, ran yarn start --env=development

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

ThaoD5 avatar Nov 14 '19 10:11 ThaoD5

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 )

ThaoD5 avatar Nov 14 '19 13:11 ThaoD5