Comments (7)
For any who happen by here in the future trying to solve
File unchanged! The supplied flag value not found! app/javascript/packs/application.js
:
Whatever your issue is it's probably not related to that message; despite being red and screamy it's more or less a warning.
During setup stimulus_reflex
will run rails webpacker:install:stimulus
, a perfectly logical thing to do. Somewhere down that rabbit hole thor
is used to insert the import "controllers"
line into the end of your application.js
file. If you've already installed stimulus (by creating your Rails app with --webpack=stimulus
for example) then thor will call replace!
:
if replace!(/#{flag}/, content, config[:force])
say_status(:invoke)
else
say_status(:unchanged, warning: WARNINGS[:unchanged_no_flag], color: :red)
end
and when replace!
returns nil
(because content
already includes replacement
) 👇
def replace!(regexp, string, force)
return if pretend?
content = File.read(destination)
if force || !content.include?(replacement)
success = content.gsub!(regexp, string)
File.open(destination, "wb") { |file| file.write(content) }
success
end
end
then say_status(:unchanged)
will be called producing one glorious red error looking message to let you know nothing happened.
At a glance I couldn't decide what I would have done differently to prevent this outcome, as it would probably involve adding a third state to replace!
so nil
is not used as both failure
and already_replaced
. That sounds like it would definitely end with significantly uglier code so I am instead opting to write a long warning to future adventurers.
Instead of typing this I could have been playing Minecraft...
I'm going to go play Minecraft. If you think of a way to change something here that would be more useful than a comment on a closed issue I encourage you to go for it.
from stimulus_reflex.
Closing! 👍
from stimulus_reflex.
I removed SR and re-installed it. The next time, I got
15:51:06 henrik@devbox remit master$ bundle exec rails stimulus_reflex:install
warning Integrity check: Top level patterns don't match
error Integrity check failed
error Found 1 errors.
========================================
Your Yarn packages are out of date!
Please run `yarn install --check-files` to update.
========================================
To disable this check, please change `check_yarn_integrity`
to `false` in your webpacker config file (config/webpacker.yml).
yarn check v1.19.1
info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.
I made sure to explicitly start bin/webpack-dev-server
, then ran yarn install --check-files
, and then ran bundle exec rails stimulus_reflex:install
again. This time I didn't get that error.
from stimulus_reflex.
Paging @andrewmcodes, our resident rake expert.
from stimulus_reflex.
Cheers! Not blocked by this anymore but could help others :)
from stimulus_reflex.
@henrik super glad that you got this wrapped up.
Could you please close the issue if it's no longer unsolved?
from stimulus_reflex.
try installing node js 16 using nvm
from stimulus_reflex.
Related Issues (20)
- Controller over reflex attribute is ignore and reflex is always called with default StimulusReflexController HOT 7
- Broken Next Page Link on Welcome Page of Docs HOT 2
- HEAD and most of the latest releases are broken, references an undefined exception
- StimulusReflex is not compatible with the standalone ActionCable server HOT 9
- Wrong dataset getting from Docs example HOT 2
- NameError: undefined local variable or method `package_json' HOT 3
- Reflex not triggered when a Stimulus controller is also attached to a field HOT 4
- Form parse errors are not captured and reported back to front-end
- Drop Rails 5 and 6.0 support
- `solid_cache` seems to work as well as Rails cache store HOT 1
- Add full-stack tests
- Stimulus_reflex and esbuild error HOT 1
- OpenStruct no longer supported by json HOT 1
- Refactor away instances of OpenStruct
- NameError: uninitialized constant StimulusReflex::Installer::Thor when running rake tasks HOT 1
- Support `relative_url_root`
- Could not find generator 'stimulus_reflex:initializer'
- Unrecognized command "esbuild" (Rails::Command::UnrecognizedCommandError)
- Installer should work in CI (noninteractive) environment
- docs recommend hiredis gem along with incompatible redis version
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stimulus_reflex.