Closed hiren-quovantis closed 5 years ago
if this fails during claudia packaging, there are two options:
1) install mysql as an optional dependency , then use --no-optional-dependencies when you deploy with claudia. it will not bundle the dependency in the package, but it will pass validation 2) lazy-load the required package (not in the file headers, but in a function on first use) to use layer dependencies that are not bundled with your code. alternatively, you can
I am referring to one of the dependencies ('mssql' included in the layer) from my index js file.
What actually happens: I get the following error: validating package Error: Cannot find module 'mssql' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15) at Function.Module._load (internal/modules/cjs/loader.js:506:25) at Module.require (internal/modules/cjs/loader.js:636:17) at require (internal/modules/cjs/helpers.js:20:18)
Steps to reproduce the problem: