-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
failed to use Webpacker::Compiler.env #2794
Comments
Ok digged google and found an article where @takeyuweb explain why it does not work on dev environment and how to circumvent the issue # bin/webpack-dev-server
require_relative '../config/application'
Rails.application.initialize! It works on production without doing anything and just fixes the development env issue Should it be addressed ? |
adding the following # bin/webpack-dev-server
require_relative '../config/environment' might serve as a shortcut for:
|
this was really helpful 👍 |
the following link should work for the https://github.com/rails/webpacker/blob/5-x-stable/docs/env.md |
Hi,
Having an issue with webpacker initializer.
As pointed in the env doc I create an initializer to pass Rails application variables to a JS frontend,
process.env.FRONTEND_API_KEY
ends up empty.It has already been talked about but left unsolved.
Am I doing something wrong or missing something ?
Originally posted by @bbugh in #691 (comment)
The text was updated successfully, but these errors were encountered: