-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Closed
Labels
Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Description
When introducing a custom .babelrc
, it's necessary to add the resetCache flag to the packager. This requires digging into node_modules
and isn't the most developer friendly (DX anybody? :P)
So we should either allow users to do:
./node_modules/react-native/packager/packager.sh clean
or
./node_modules/react-native/packager/packager.sh -root . -clean
Also open to other solutions! cc @amasad
junkycoder, yusukeshib, alwayalive, matthargett, bewarsalah and 1 more
Metadata
Metadata
Assignees
Labels
Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
cyprusglobe commentedon Jul 9, 2015
+1
dozoisch commentedon Jul 9, 2015
👍
shlomiatar commentedon Jul 9, 2015
We use this quick and dirty gulp task:
brentvatne commentedon Jul 10, 2015
Nice one @shlomiatar! Could you submit a pull request to add that command to the packager?
fabiomcosta commentedon Jul 13, 2015
+1
fabiomcosta commentedon Jul 13, 2015
ideally the cache key would consider the current babel transforms
zallek commentedon Jul 28, 2015
+1 thanks for the tip, and yeh a clean command would be appreciated :)
amasad commentedon Sep 8, 2015
@martinbigio just shipped a diff that adds support for this. Should land soon.
gaearon commentedon Sep 17, 2015
alejomendoza commentedon Sep 19, 2015
👍 this is such an annoying bug 🪲 where do we add the gulp task?
shlomiatar commentedon Sep 20, 2015
@alejomendoza,
You can install gulp by running
npm install -g gulp
.then, you add
gulpfile.js
and add the task in it (and require the dependencies,os
andfs
)you can run the task by typing
gulp clear-cache
on the same folder as the gulpfile.good luck! :)
27 remaining items
j2kun commentedon Feb 27, 2017
@lprhodes This doesn't work for non-javascript file changes. What I have been doing (a really crappy workaround) is creating a watchman trigger for my specific file to run
But this doesn't even work because I have to restart the packager for it to pick up that these cache files got deleted. I would really love a way to say "Hey packager, when this file changes, please re-transpile this other JS file!" But I've been searching and experimenting for a week and can't figure out how to do this.
j2kun commentedon Feb 27, 2017
This was the solution I was able to come up with. Would appreciate any suggestions for improvements, or better yet a principled way to do it
http://stackoverflow.com/questions/42212314/tell-react-native-packager-to-watch-a-non-javascript-file/42497592#42497592
Fix suggestion to "npm start -- --reset-cache"
Fix suggestion to "npm start -- --reset-cache"
Fix suggestion to "npm start -- --reset-cache"
Fix suggestion to "npm start -- --reset-cache"
david-a commentedon Oct 9, 2017
I had to remove both
react-native-packager-cache-*
(directory) ANDhaste-map-react-native-packager-*
(file) from$TMPDIR
thank you all
tarheele commentedon Nov 18, 2017
On windows, I made the mistake of renaming node_modules to node_modules.todelete in an effort to debug an issue. Something cached this and gave me an error
P: error: bundling failed: ambiguous resolution: module [mymodule] tries to require 'react-native', but there are several files providing this module. You can delete or fix them:
The key for me was the haste removal tip by @david-a
I am sharing this mainly so folks can find the error text I encountered
leoskyrocker commentedon Dec 27, 2017
https://gist.github.com/jarretmoses/c2e4786fd342b3444f3bc6beff32098d#gistcomment-2277722