{"action":"opened","issue":{"url":"https://api.github.com/repos/facebook/reason/issues/1939","repository_url":"https://api.github.com/repos/facebook/reason","labels_url":"https://api.github.com/repos/facebook/reason/issues/1939/labels{/name}","comments_url":"https://api.github.com/repos/facebook/reason/issues/1939/comments","events_url":"https://api.github.com/repos/facebook/reason/issues/1939/events","html_url":"https://github.com/facebook/reason/issues/1939","id":323841533,"number":1939,"title":"bsb periodically deleting generated JS files","user":{"login":"brightpuddle","id":3242016,"avatar_url":"https://avatars3.githubusercontent.com/u/3242016?v=4","gravatar_id":"","url":"https://api.github.com/users/brightpuddle","html_url":"https://github.com/brightpuddle","followers_url":"https://api.github.com/users/brightpuddle/followers","following_url":"https://api.github.com/users/brightpuddle/following{/other_user}","gists_url":"https://api.github.com/users/brightpuddle/gists{/gist_id}","starred_url":"https://api.github.com/users/brightpuddle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brightpuddle/subscriptions","organizations_url":"https://api.github.com/users/brightpuddle/orgs","repos_url":"https://api.github.com/users/brightpuddle/repos","events_url":"https://api.github.com/users/brightpuddle/events{/privacy}","received_events_url":"https://api.github.com/users/brightpuddle/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-17T01:30:17Z","updated_at":"2018-05-17T01:30:17Z","closed_at":null,"author_association":"NONE","body":"While editing files, sometimes bsb will delete the destination .bs.js file. Typically, saving the .re file again will regenerate the .bs.js file. This causes significant problems with upstream tools, e.g. webpack-dev-middleware/hot-middleware fails, emits lots of errors, and forces a live reload.\r\n\r\nIt seems to happen more easily/consistently on a larger project with more files and dependencies, but I can reproduce it directly from the basic-reason and react templates with *a lot* of repeated saves.\r\n\r\n### Steps to reproduce\r\n\r\nStandard project init:\r\n\r\n1. `bsb -init blah -theme basic-reason`\r\n2. `cd blah &&  yarn start`\r\n\r\nIn another terminal:\r\n\r\n`nodemon ./src/Demo.bs.js`\r\n\r\nIn the editor, save Demo.re repeatedly. It takes *a lot* of saves for this to happen, but I can reproduce it in any project. Happens almost immediately if the saves are performed quickly, but it also happens with normal editing, so doesn't seem to purely a rate issue.\r\n\r\n### Output\r\n\r\n**bsb output** (the last build is the one that failed)\r\n\r\n```>>>> Start compiling\r\nRebuilding since [ [ 'rename', 'Index.re' ], [ 'rename', 'Index.re~' ] ]\r\nninja: Entering directory `lib/bs'\r\nninja: no work to do.\r\n>>>> Finish compiling\r\n>>>> Start compiling\r\nRebuilding since [ [ 'rename', 'Index.re' ], [ 'rename', 'Index.re~' ] ]\r\nninja: Entering directory `lib/bs'\r\nninja: no work to do.\r\n>>>> Finish compiling\r\n>>>> Start compiling\r\nRebuilding since [ [ 'rename', '4913' ] ]\r\nninja: Entering directory `lib/bs'\r\n[2/2] Building src/Index.mlast.d\r\n[1/1] Building src/Index-ReactTemplate.cmj\r\n>>>> Finish compiling\r\n>>>> Start compiling\r\nRebuilding since [ [ 'rename', 'Index.re' ],\r\n  [ 'rename', 'Index.re~' ],\r\n  [ 'rename', 'Index.re' ],\r\n  [ 'rename', 'Index.re~' ] ]\r\nninja: Entering directory `lib/bs'\r\nninja: no work to do.\r\n>>>> Finish compiling```\r\n\r\n*nodemon output*\r\n\r\n```[nodemon] starting `node src/Index.bs.js`\r\nmodule.js:549\r\n    throw err;\r\n    ^\r\n\r\nError: Cannot find module '/Users/nathan/src/test/reason/blah/src/Index.bs.js'\r\n    at Function.Module._resolveFilename (module.js:547:15)\r\n    at Function.Module._load (module.js:474:25)\r\n    at Function.Module.runMain (module.js:693:10)\r\n    at startup (bootstrap_node.js:188:16)\r\n    at bootstrap_node.js:609:3\r\n[nodemon] app crashed - waiting for file changes before starting...```\r\n\r\n### System details:\r\n\r\nMacOS 10.13.4 (High Sierra)\r\nEditor: neovim\r\nbs-platform v3.0.0\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"brightpuddle"}}