We are trying to migrate our Nativescript project to angular 10. We currently have the problem that the reference to some plugin, for example nativescript-oauth2 generates errors.
ERROR in ../node_modules/nativescript-oauth2/tns-oauth-login-webview-controller.js
Module not found: Error: Can't resolve 'tns-core-modules/ui/action-bar/action-bar in 'xxx'
We tried a lot of different combinations in ngcc.config.js but none is working. Could you please give some advise how this problem could be solved? How should the configurations in this file look like?
@Bidou44 although this is not exactly a long term solution, I did a thing to get through these errors. Just modify the offending files in node_modules that have a double-path entry (e.g. tns-core-modules/ui/action-bar/action-bar) and remove the last path part. e.g. tns-core-modules/ui/action-bar.
I'm sure there's a more elegant way to accomplish this, but hack-and-slash gets my app running (almost).
For a more long term solution (than modifying node_modules).
I updated my resolve.alias in webpack.config.js:
resolve: {
// ... other parts of webpack's resolve config here
alias: {
'~': appFullPath,
// this has to come before the next alias or you still get the same error.
"tns-core-modules/file-system/file-system": "@nativescript/core/file-system",
"tns-core-modules": "@nativescript/core",
"nativescript-angular": "@nativescript/angular"
},
},
I think everyone should still be using webpack so hopefully this helps.
The issue I had related to @nstudio/nativescript-camera-plus hence file-system instead of action-bar but you should be able to do the same thing with action-bar.
Excellent! It worked like a charm!
Most helpful comment
For a more long term solution (than modifying node_modules).
I updated my
resolve.aliasin webpack.config.js:I think everyone should still be using webpack so hopefully this helps.
The issue I had related to
@nstudio/nativescript-camera-plushencefile-systeminstead ofaction-barbut you should be able to do the same thing withaction-bar.