-
Notifications
You must be signed in to change notification settings - Fork 135
config-const.js emptied on new file with gulp watch #363
Comments
Related to #227 but happens with only |
EDIT: Hi @ruddell! # post the result of the following commands
node -v # node version
npm -v # npm version
npm list -g generator-m-ionic # generator version
|
I can confirm that this issue does not occur on the demo project, but if you generate a project with the .yo-rc.json from my initial post, the issue is present. I also experienced it with iOS as a platform Repo with commits at each step (.yo-rc.json, generation, initial gulp watch, and changes after generating/adding a file) https://github.com/ruddell/m-ionic-test
|
Thank you for your very fine reporting and the nice demo repo! :) Unfortunately I still cannot reproduce the issue. Here's what I did: git clone git@github.com:ruddell/m-ionic-test.git
cd m-ionic-test
npm i && bower i
gulp watch And then: $ yo m-ionic:controller acontroller
You called the m-ionic:constant subgenerator.
You called the m-ionic:controller subgenerator.
create app/main/controllers/acontroller-ctrl.js
create test/karma/main/acontroller-ctrl.spec.js
$ gs
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: app/index.html
Untracked files:
(use "git add <file>..." to include in what will be committed)
app/main/controllers/acontroller-ctrl.js
test/karma/main/acontroller-ctrl.spec.js
no changes added to commit (use "git add" and/or "git commit -a") I'd recommend deleting the I'm out of ideas for now. You could probably remove the |
I'm sorry, I pushed the blank config file to show the flow of actions. I reversed the commit and tested the repo again (using your process from the last post) and I get the following:
|
Wops. Of course it didn't work then ;) I tried again, 5 times and still I cannot reproduce. gulp -v Mine is: $ gulp -v
[10:02:21] CLI version 3.9.0
[10:02:21] Local version 3.9.1 Maybe you can upgrade to the latest version? However I noticed that sometimes the SCSS/CSS doesn't render after a new file is created. Do you get that as well? |
I tested on a new ubuntu-upstart docker image and I could not reproduce the issue so it has to be something with my setup. Sorry for taking up your time, but at least we found a different issue. It looks like the css file is deleted and not recreated, leaving the project without styling. Restarting |
Hey, i just wanted to let you know that I have same issue, so maybe there is something more to it. Same with the css file. |
Same problem for me...
|
Are you guys using Webstorm (or whatever is based on IntelliJ) for editing? This could be the reason for the problem. My hypothesis is that is somehow an I/O issue between gulp and web storm indexing the file. I excluded the constants directory from the project scope, which fixed the problem for me. If that is the case, it is not problem of the generator and issue can be closed. |
I am using vim. |
Everybody willing to help or experiencing this issue, please provide the following formatted as below. That way I might find a way to reproduce this (which I currently cannot) and try to fix this.
# post the result of the following commands
node -v # node version
npm -v # npm version
npm list -g generator-m-ionic # generator version
gulp -v For me this would be:
|
@gruppjo I believe this issue occurs when injecting into the same file more than once at the same time. See the last comment klei/gulp-inject#123 From the original post's gulp output log (seen when I reproduce the issue), two injections at the same time:
In injecting.js, the I'll look more into this issue this weekend. The commit I referenced this fixes it in most cases, but if you run the generator several times quickly it occasionally clears it still... |
We migrated |
When I downgraded to 3.0.0, the issue disappears. I still have the css get deleted like you mention. I generated foobar.ctrl.js and foobar2.ctrl.js, line 72 of the gulp log shows the css being deleted from the .tmp folder http://pastebin.com/mKrhRfsy |
Thanks for verifying! |
@ruddell, did you have a chance to test this with gulp-inject@4.1.0? |
I can no longer reproduce the error using gulp-inject@4.1.0. SCSS still fails to compile occasionally |
Nice. Thanks for your valuable input @ruddell! Then no more actions are necessary. Let's hope this issue doesn't return. |
Hey, I'm loving the generator, thank you for all of the work.
Overview of the issue
When running
gulp watch
, if a new file is added to the project (copied or generated), the config-const.js file is erased (all lines of the file are removed). This will then cause running the project and building the project to fail as there is no Config constant to inject.The gulp output from the Reproduce the Error section below can be seen http://pastebin.com/raw/Dn6f8Ktw
Version(s)
1.8
Configuration file
Reproduce the error
In new terminal tab
Also happens if you copy a file into the project instead of generating a new one.
Fix
I haven't looked into how to fix it, not the best with gulp.
The text was updated successfully, but these errors were encountered: