nx-firebase: Build command is broken with @nrwl/workspace >= 13.10.0
When running the build command through NX when @nrwl/workspace is installed with a version of 13.10.0 or greater, the following error occurs:
assets_1.copyAssetFiles is not a function
It seems as though the copyAssetFiles function was removed from @nrwl/workspace/src/utilities/assets in 13.10.0, looking at this commit. I’m not sure if this is an intentional change on their part; I can’t seem to find any notes on it.
Tested with both 13.10.0 and 13.10.1 (the latest at time of writing). This doesn’t appear to be addressed as part of #45, so I figured I would open a separate issue for this.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 3
- Comments: 17 (2 by maintainers)
I’ve been reviewing the latest nx code for 13.10.x this afternoon and it seems there’s been a fair few changes since I last released this plugin against nx 12.x
Most significantly they’ve merged the node:package functionality into the js:tsc package so I’m going to need to take a good look over that to bring the plugin code upto spec with the latest nx code.
The patches and comments above have been really useful, thanks everyone.
That said, I dont (yet) see how I can use them in the plugin source code - it really feels like I need to update the plugin to use the latest nx plugin apis, so thats what’ll I’m doing atm.
what I did to get anandsathe67 patch-package working:
now whenever you run yarn install, you should see in the output something from patch-package like so
yarn install v1.22.15 [1/4] 🔍 Resolving packages… success Already up-to-date. $ patch-package patch-package 6.4.7 Applying patches… @simondotm/nx-firebase@0.3.3 ✔ ✨ Done in 1.40s.
@simondotm+nx-firebase+0.3.3.patch.txt
This is a cumulative patch for this issue and #44
Changing line 74 of src/executors/build/build.js to
yield Promise.all(normalizedOptions.files.map((file) => copy(file.input, file.output)));instead ofassets_1.copyAssetFiles ....and adding an importconst { copy } = require("fs-extra/lib/copy");fixes this issue
This appears to be fixed in v0.3.4, tested running in Nx 13.10.6
@nrwl/node:package -> @nrwl/js:tsc.
I was using this executor in my workspace json and hence had to make the change when I migrated to nx 13.x Not sure why patch-package is telling you the patch isnt required. The issues you are seeing in your gist are the ones which the patch (which I had earlier uploaded to #44) includes. I did not see this when i applied it to #45 - the patch did get applied