Konnector: Cannot find module './src/index.js'


#1

Hi !

What did you do?

I’m actually trying to understand to OAuth Flow of a konnector in order to write my own one. To do so I’ve downloaded the cozy-konnector-template. I’m able to communicate with the API in standalone mode without any trouble.

What happened?

The next step was to run it in a cozy environment. I’ve a local stack running. I tried to run the ‘yarn dev’ cmd, after the konnector form validation an error occured:

Error: Cannot find module ‘./src/index.js’
Require stack:

  • D:\Profiles*\enedis-api-connector\node_modules\cozy-jobs-cli\src\konnector-dev.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
    at Function.Module._load (internal/modules/cjs/loader.js:690:27)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at launchKonnector (D:\Profiles*
    \enedis-api-connector\node_modules\cozy-jobs-cli\src\konnector-dev.js:118:12)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async main (D:*\playground\enedis-api-connector\node_modules\cozy-jobs-cli\src\konnector-dev.js:101:3) {
    code: ‘MODULE_NOT_FOUND’,
    requireStack: [
    'D:\Profiles\
    *\enedis-api-connector\node_modules\cozy-jobs-cli\src\konnector-dev.js’
    ]

I also tried to run the same flow with some of your konnectors with the same issue( google and misterauto ). Can you help me on this one ?


#2

Hello, I see you are under windows environment. Connectors do not use features incompatible with windows environment but we do not test it under windows at the moment.

If you can, please try to develop the connecteur in a linux or mac environment. You can use a virtual machine for example.

On my side, I created a github issue : https://github.com/konnectors/libs/issues/630


#3

I am sorry @hsubtil. It appears that we could reproduce the same problem under linux. This was a recent regression.

I release a new version of cozy-konnector-libs and cozy-jobs-cli and the template is updated accordingly. Can you run your connector with these new versions ?


#4

Thank you for the quick reply ! I was installing a linux env in order to test.
It works on windows for me now !