Skip to content

Error: Cannot find module 'undefined/path/to/functions'Β #135

@olaven

Description

@olaven

Hi πŸ‘‹
I am very new to Serverless, so I may be skipping something relatively obvious.

I have set up a test-template/test as per this guide. The test function generated by the template looks like it is passing the correct values to mochaPlugin, however the tests do not run and the following is printed out in the console:

# NOTE: PATH_TO_MY_PROJECT added by me
Error: Cannot find module 'undefined/src/functions/testFunction.js'
Require stack:
- /Users/olaven/PATH_TO_MY_PROJECT/node_modules/serverless-mocha-plugin/index.js
- /Users/olaven/PATH_TO_MY_PROJECT/src/tests/testFunction.js
- /Users/olaven/PATH_TO_MY_PROJECT/node_modules/mocha/lib/esm-utils.js
- /Users/olaven/PATH_TO_MY_PROJECT/node_modules/mocha/lib/mocha.js
- /Users/olaven/PATH_TO_MY_PROJECT/node_modules/mocha/lib/cli/one-and-dones.js
- /Users/olaven/PATH_TO_MY_PROJECT/node_modules/mocha/lib/cli/options.js
- /Users/olaven/PATH_TO_MY_PROJECT/node_modules/mocha/bin/mocha
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)

Is this a known issue?

Have a great day πŸ˜„

  • olaven

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions