When doing ionic serve and make changes in assets directory (actually a subdirectory in assets) changes are not catched by the watcher.
In my case i have translation-files for ng2-translate there and saving them doesnt copy them to the assets in www folder.
On save it says [21:41:11] watch ready but nothing else happens. Trying to reload browser doesnt help and when checking i see that the new file are not copied in place. Even restarting the serve doesnt copy the files. Have to delete the assets folder in www to make the new files beeing copied.
The changed files should be copied and a reload done.
Which @ionic/app-scripts version are you using?
0.0.36
Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)
Ionic Framework Version: 2.0.0-rc.1
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
OS: Windows 10
Node Version: v6.7.0
Which operating system are you using? Thanks
I am on latest windows 10.
Me too :-(
Related post: https://forum.ionicframework.com/t/ionic-serve-reload-ignoring-json-translation-changes/67114
Same here even on stopping/starting again "ionic serve"
Using the last version of ionic-app-scripts 0.0.36
macOS Sierra
src/assets aren't copied to / doesn't overwrite www/assets
Some additional debug info when saving changes to nb.json in src\assets\i18n folder:
ionic $ [ DEBUG! ] watch callback start, id: 0, isProd: false, event: change, path: src\assets\i18n\nb.json
MEM: 682.2MB
[ DEBUG! ] watch callback complete, id: 0, isProd: false, event: change, path: src\assets\i18n\nb.json
MEM: 682.2MB
[ DEBUG! ] copyUpdate, event: change, path: src\assets\i18n\nb.json MEM: 682.2MB
[19:11:14] watch ready
@sveinl Would you mind trying this with our latest beta app-scripts release (install with npm install @ionic/app-scripts@beta) ? There was a small change around when the copy task ran that should have fixed this. Thanks!
Yes, it works in 0.0.37 so all is fine.
@jgw96: do you have a Link to the bugfix, thanks..
Just do npm install @ionic/app-scripts@beta in your project.
Same problem happening with me on device run (android), while it was working with browser.
So I did npm install @ionic/app-scripts@beta
But now, when doing ionic run android, am getting errors like this.
Any help pls.
[17:48:26] lint started ...
[17:48:36] Error: Error Cannot write file '/Users/saiy2k/projects/ion/gg/.tmp/app/app.component.d.ts' because it would
overwrite input file.
[17:48:36] Error Cannot write file '/Users/saiy2k/projects/ion/gg/.tmp/pages/chat/chat-box.component.d.ts' because it
would overwrite input file.
[17:48:36] Error Cannot write file '/Users/saiy2k/projects/ion/gg/.tmp/pages/event/album-tab.component.d.ts' because it
would overwrite input file.
[17:48:36] Error Cannot write file '/Users/saiy2k/projects/ion/gg/.tmp/pages/event/coordinator.component.d.ts' because
it would overwrite input file.
[17:48:36] Error Cannot write file '/Users/saiy2k/projects/ion/gg/.tmp/pages/event/event-card.component.d.ts' because
it would overwrite input file.
[17:48:36] Error Cannot write file '/Users/saiy2k/projects/ion/gg/.tmp/pages/event/event.service.d.ts' because it would
overwrite input file.
[17:48:36] Error Cannot write file '/Users/saiy2k/projects/ion/gg/.tmp/pages/event/feedback/feedback.component.d.ts'
because it would overwrite input file.
[17:48:36] Error Cannot write file '/Users/saiy2k/projects/ion/gg/.tmp/pages/event/home-tab.component.d.ts' because it
would overwrite input file.
My ionic info
Cordova CLI: 6.3.0
Gulp version: CLI version 3.9.1
Gulp local:
Ionic Framework Version: 2.0.0-rc.1
Ionic CLI Version: 2.1.4
Ionic App Lib Version: 2.1.2
Ionic App Scripts Version: 0.0.37-5
ios-deploy version: Not installed
ios-sim version: 5.0.6
OS: Mac OS X El Capitan
Node Version: v4.2.6
Xcode version: Xcode 8.0 Build version 8A218a
Sometimes deleting the .tmp folder solves the problem.
Thanks @sveinl It helped clear those issues.
But still the assets are not being copied (in device). While it's working good in browser.
Screenshot of
Resources tab of Chrome Dev tools
Any update on this?
@dylanvdmerwe just to be clear, this is only an issue with prod builds to a device right? Not dev builds?
I think the problem is that it is looking at the filename which has not changed?
Hang on @jgw96, we need to retest this latest version of app-scripts .39. We're still on .36. Will let you know.
@jgw96 The same happens on 0.0.39, as well. And yes, this happens only in device and not in browser.
My package.json, after updating to RC2
"dependencies": {
"@angular/common": "2.1.1",
"@angular/compiler": "2.1.1",
"@angular/compiler-cli": "2.1.1",
"@angular/core": "2.1.1",
"@angular/forms": "2.1.1",
"@angular/http": "2.1.1",
"@angular/platform-browser": "2.1.1",
"@angular/platform-browser-dynamic": "2.1.1",
"@angular/platform-server": "2.1.1",
"@ionic/storage": "1.1.6",
"ionic-angular": "2.0.0-rc.2",
"ionic-native": "2.2.3",
"ionicons": "3.0.0",
"ng2-translate": "^3.1.3",
"rxjs": "5.0.0-beta.12",
"zone.js": "0.6.21"
},
"devDependencies": {
"@ionic/app-scripts": "0.0.39",
"@types/request": "0.0.30",
"typescript": "^2.0.3"
},
Upgraded to 0.0.43, still the problem persists in Device build.
My package.json:
Cordova CLI: 6.3.0
Gulp version: CLI version 3.9.1
Gulp local:
Ionic Framework Version: 2.0.0-rc.2
Ionic CLI Version: 2.1.4
Ionic App Lib Version: 2.1.2
Ionic App Scripts Version: 0.0.43
ios-deploy version: Not installed
ios-sim version: 5.0.6
OS: Mac OS X Sierra
Node Version: v4.2.6
Xcode version: Xcode 8.0 Build version 8A218a
I have the same problem in Windows, I needed to remove all files in www folder.
[10:38:52] ionic-app-scripts 0.0.45
[10:38:52] build dev started ...
[10:38:52] clean started ...
[10:38:52] clean finished in 6 ms
[10:38:52] copy started ...
[10:38:52] transpile started ...
[10:38:57] transpile finished in 5.00 s
[10:38:57] webpack started ...
[10:38:58] copy: Error copying "D:\Project\ionic-demo\src\assets" to
"D:\Project\ionic-demo\www\assets"
[10:38:58] copy: Error copying "D:\Project\ionic-demo\node_modules\ionicons\dist\fonts" to
"D:\Project\ionic-demo\www\assets\fonts"
[10:38:58] copy finished in 5.34 s
[10:39:06] webpack finished in 8.48 s
[10:39:06] sass started ...
[10:39:11] sass finished in 4.73 s
[10:39:11] build dev finished in 18.25 s
Error: No valid MSBuild was detected for the selected target.
I believe this should be fixed now. Please let me know if it's not.
Thanks,
Dan
This problem remains. I updated the scripts to latest "npm聽install聽@ionic/app-scripts@latest聽--save-dev", and deployed to Android device, but the folder assets/i18n is not copied.
@miguel99marques, src/assets/i18n is not copied? Do you have a custom copy config?
Thanks,
Dan
No!
my config is as follow:
<widget id="com.ionicframework.amipivothost795578" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Pivot.Host</name>
<description>TT</description>
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
<content src="index.html"/>
<preference name="loadUrlTimeoutValue" value="700000" />
<access origin="*"/>
<allow-intent href="http://*/*"/>
<allow-intent href="https://*/*"/>
<allow-intent href="tel:*"/>
<allow-intent href="sms:*"/>
<allow-intent href="mailto:*"/>
<allow-intent href="geo:*"/>
<platform name="android">
<allow-intent href="market:*"/>
</platform>
<platform name="ios">
<allow-intent href="itms:*"/>
<allow-intent href="itms-apps:*"/>
</platform>
<preference name="webviewbounce" value="false"/>
<preference name="UIWebViewBounce" value="false"/>
<preference name="DisallowOverscroll" value="true"/>
<preference name="android-minSdkVersion" value="16"/>
<preference name="BackupWebStorage" value="none"/>
<preference name="SplashMaintainAspectRatio" value="true"/>
<preference name="FadeSplashScreenDuration" value="300"/>
<feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar"/>
</feature>
<plugin name="ionic-plugin-keyboard" spec="~2.2.1"/>
<plugin name="cordova-plugin-whitelist" spec="1.3.1"/>
<plugin name="cordova-plugin-console" spec="1.0.5"/>
<plugin name="cordova-plugin-statusbar" spec="2.2.1"/>
<plugin name="cordova-plugin-device" spec="1.1.4"/>
<plugin name="cordova-plugin-splashscreen" spec="~4.0.1"/>
</widget>
I figure it out!
It was problem of the code, where i was this.translate.setDefaultLang("EN") in upper case, and the files were in lowercase.
In browser it worked well, but in android not, so after setting to lowercase get working.
Thanks
I'm still facing this issue. Any advice?
Check that the JSON is well formed. This type of file is very sensitive.
For example, check that the last element does not have a comma at the end.
{
"DELETE_BUTTON": "Delete",
"CARDS_TITLE": "Social",
"SEARCH_TITLE": "Search"
}