Skip to content

Commit bf3c712

Browse files
authored
docs: add Jest+NestJS troubleshooting solution (#1859)
Update Module Not Found FAQ to include info on Nest JS/Jest fix.
1 parent a416c5d commit bf3c712

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

packages/website/pages/docs/troubleshooting.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ Module not found: Can't resolve 'ipfs-car/blockstore/memory' in '/workspace/Unst
2929

3030
If possible, upgrading your project to use Webpack 5 or adopting an alternative bundler like [Vite](https://vitejs.dev/) should fix the issue. If your project was built using an older version of [create-react-app](https://create-react-app.dev/) and has not been "ejected" to use a custom configuration, you should be able to update to the latest `react-scripts` dependency by following [the update documentation](https://create-react-app.dev/docs/updating-to-new-releases/).
3131

32+
You may see similar errors when using Jest to run unit tests for projects built on NestJS. A working example using NestJS and Jest is available on [GitHub](https://github.com/alanshaw/nest-nftstorage).
33+
34+
Try the following to resolve:
35+
36+
1. Install the dependency: ```npm i -D enhanced-resolve```
37+
2. Add the file located [here](https://github.com/alanshaw/nest-nftstorage/blob/main/test/export-maps-resolver.js)
38+
3. Configure it as a [resolver](https://github.com/alanshaw/nest-nftstorage/blob/main/package.json#L72)
39+
40+
You can read more about the Jest [fix](https://github.com/facebook/jest/issues/9771#issuecomment-841624042) for this issue. Jest v28 is expected to incorporate this fix once a stable release is available.
41+
3242
If you don't want to change your build setup, you can import a pre-bundled and minified version of the package by changing the import statement:
3343

3444
```js
@@ -50,4 +60,4 @@ This error can occur because of having an old version of Node. We no longer offe
5060

5161
### Don't See Your Question Answered?
5262

53-
[Chat with us in #nft-storage on IPFS discord](https://discord.com/invite/KKucsCpZmY)
63+
[Chat with us in #nft-storage on IPFS discord](https://discord.com/invite/KKucsCpZmY)

0 commit comments

Comments
 (0)