-
Notifications
You must be signed in to change notification settings - Fork 39
Build issue in Angular 8 project (with resolution) #96
Comments
@mikeal What do you think about removing |
It’s a breaking change so we shouldn’t consider that the fix for this change. I think we should experiment with something like |
I just think that having |
Same issue on a project using Webpack, I fixed it by adding an alias on resolve: {
alias: {
'multicodec/src/base-table': path.dirname(
require.resolve('multicodec/src/base-table.json')
)
}
}, |
let's just get this specific issue fixed before making more radical changes, adding explicit .json extensions in require is good practice anyway #97 |
Hi I created a PR to fix this issue: #100 |
@qu37zal @leandroyalet @ilirhushi I've just released version 0.7.2. Could you please confirm that it fixes this issue? |
@vmx yes, works correctly now |
@vmx yep for me too, thanks 🚀 |
I have an Angular project using some ipfs related packages with cids as a dependency. My ng build fails with the following error:
ERROR in ./node_modules/cids/src/index.js
Module not found: Error: Can't resolve 'multicodec/src/base-table'
Upon investigation, I found that cids has multicodec as a dependency, and attempts to import a json file using require without specifying the file suffix. This results in the file not being identified and the aforementioned error. By specifying 'multicodec/src/base-table.json' the issue can be bypassed.
I'm happy to submit a patch if you like. I'd like to get this fixed in the upstream so I don't have to patch it locally in a postinstall step. I believe it is not considered best practice to import json in this way, so I'd propose it be imported using fs.readFile/JSON.parse, but the remedy above works as well.
The text was updated successfully, but these errors were encountered: