triniwiz/nativescript-couchbase-plugin

Migrate plugin to use new @nativescript/core imports

Closed this issue · 2 comments

Make sure to check the demo app(s) for sample usage

Make sure to check the existing issues in this repository

If the demo apps cannot help and there is no issue for your problem, tell us about it

The current version of the plugin works perfectly with NS 7 because of the webpack alt loading modules. But just upgraded a project to NS 8 / Webpack 5 and the plugin no longer works. Webpack fails to compile:

ERROR in ./node_modules/nativescript-couchbase-plugin/couchbase-plugin.ios.js 4:12-51
Module not found: Error: Can't resolve 'tns-core-modules/utils/types' in '/Users/peter/Projects/SwyftCG/node_modules/nativescript-couchbase-plugin'
 @ ./app/shared/db-manager.ts 2:0-92 46:22-31 181:29-53 187:29-53 193:29-53 515:29-53 521:29-53 527:29-53 533:29-53 549:29-53 555:29-53 561:29-53 584:29-53 590:29-53 596:29-53 720:21-33
 @ ./app/ sync .(xml|js|ts|s?css)$ ./shared/db-manager.ts
 @ ./app/__@nativescript_webpack_virtual_entry_typescript__ 3:16-92

ERROR in ./node_modules/nativescript-couchbase-plugin/couchbase-plugin.ios.js 5:9-48
Module not found: Error: Can't resolve 'tns-core-modules/file-system' in '/Users/peter/Projects/SwyftCG/node_modules/nativescript-couchbase-plugin'
 @ ./app/shared/db-manager.ts 2:0-92 46:22-31 181:29-53 187:29-53 193:29-53 515:29-53 521:29-53 527:29-53 533:29-53 549:29-53 555:29-53 561:29-53 584:29-53 590:29-53 596:29-53 720:21-33
 @ ./app/ sync .(xml|js|ts|s?css)$ ./shared/db-manager.ts
 @ ./app/__@nativescript_webpack_virtual_entry_typescript__ 3:16-92

Which platform(s) does your issue occur on?

  • iOS/Android/Both
  • iOS/Android versions
  • emulator or device. What type of device?

Please, provide the following version numbers that your issue occurs with:

  • CLI: (run tns --version to fetch it)
  • Cross-platform modules: (check the 'version' attribute in the
    node_modules/tns-core-modules/package.json file in your project)
  • Runtime(s): (look for the "tns-android" and "tns-ios" properties in the package.json file of your project)
  • Plugin(s): (look for the version numbers in the package.json file of your
    project and paste your dependencies and devDependencies here)

Please, tell us how to recreate the issue in as much detail as possible.

Describe the steps to reproduce it.

Is there any code involved?

  • provide a code example to recreate the problem
  • (EVEN BETTER) provide a .zip with application or refer to a repository with application where the problem is reproducible.

Hey @PeterStaev it's under @triniwiz/nativescript-couchbase here is for v6 support all v7+ plugins are here

Sorry, missed the note in the Readme...