Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails if outputFile specifies a non-existing directory #149

Closed
kevinansfield opened this issue Jan 6, 2020 · 4 comments · Fixed by broccolijs/broccoli-output-wrapper#10

Comments

@kevinansfield
Copy link

After upgrading to 4.2.1 our ember builds started failing (at least on macOS).

>> (node:52291) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '/var/folders/30/3l01y1ld18l598kxr5srm7kr0000gn/T/broccoli-52291zjOJHNK9FLVI/out-541-simple_concat_concat/assets/codemirror/codemirror.js'
>>     at Object.openSync (fs.js:443:3)
>>     at Object.writeFileSync (fs.js:1194:35)
>>     at Object.handleFs (/Users/kevinansfield/code/ghost/Ghost/core/client/node_modules/broccoli-concat/node_modules/broccoli-output-wrapper/dist/index.js:45:44)
>>     at Concat._doPatchBasedBuild (/Users/kevinansfield/code/ghost/Ghost/core/client/node_modules/broccoli-concat/concat.js:166:17)
>>     at Concat.build (/Users/kevinansfield/code/ghost/Ghost/core/client/node_modules/broccoli-concat/concat.js:104:19)
>>     at resolve (/Users/kevinansfield/code/ghost/Ghost/core/client/node_modules/broccoli/dist/wrappers/transform-node.js:68:45)
>>     at new Promise (<anonymous>)
>>     at TransformNodeWrapper.build (/Users/kevinansfield/code/ghost/Ghost/core/client/node_modules/broccoli/dist/wrappers/transform-node.js:53:16)
>>     at Promise.resolve.then.then.then (/Users/kevinansfield/code/ghost/Ghost/core/client/node_modules/broccoli/dist/builder.js:99:36)
>>     at process._tickCallback (internal/process/next_tick.js:68:7)

The relevant part of our ember-cli-build.js where we use broccoli-concat is as follows:

let jsTree = concat(tree, {
    outputFile: 'assets/codemirror/codemirror.js',
    headerFiles: ['lib/codemirror.js'],
    inputFiles: ['mode/**/*'],
    sourceMapConfig: {enabled: false}
});

Changing the outputFile to remove the directory allows that step of the build to pass. Downgrading to 4.0.0 and keeping the directory in outputFile also allows works fine.

kevinansfield added a commit to TryGhost/Admin that referenced this issue Jan 6, 2020
no issue

- 4.2.1 was failing when building on macOS due to an issue creating asset directories
- broccolijs/broccoli-concat#149
@bendemboski
Copy link

This is the culprit -- changing from fs-extra's outputFileSync which creates missing directories to wherever that writeFileSync points, which apparently does not.

bendemboski referenced this issue Feb 8, 2020
Using ergonomically better way to access input files and write to output
@rwjblue
Copy link
Member

rwjblue commented Feb 10, 2020

@SparshithNR - Can you look into this? I think we'll need to make some changes in broccoli-output-wrapper to accommodate...

@SparshithNR
Copy link
Contributor

daniellockyer added a commit to TryGhost/Admin that referenced this issue Apr 30, 2020
no issue

- originally added because of broccolijs/broccoli-concat#149, but this _should_ be fixed now
@kevinansfield
Copy link
Author

Closing as this appears to have been resolved. Thanks! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants