Closed feryardiant closed 2 years ago
Hi @feryardiant could you show your config? most probably you need to mark sqlite3
as external
most probably you need to mark
sqlite3
as external
Tried your suggestion and seems it solve my issue
custom:
esbuild:
minify: true
+ exclude:
+ - sqlite3
watch:
pattern: ['./main.js', '(lib|functions)/**/*.js'] # default .
ignore: [.build, 'dist', 'node_modules', '.serverless']
Thank you
My apology for reopening this issue. Because I got another error like these
Error: Cannot find module '../../dialects/sqlite3/index.js'
Require stack:
- D:\path\to\project\backend\.esbuild\.build\functions\index.js
- D:\path\to\project\node_modules\serverless-offline\dist\lambda\handler-runner\in-process-runner\InProcessRunner.js
- D:\path\to\project\node_modules\serverless-offline\dist\lambda\handler-runner\in-process-runner\index.js
- D:\path\to\project\node_modules\serverless-offline\dist\lambda\handler-runner\HandlerRunner.js
- D:\path\to\project\node_modules\serverless-offline\dist\lambda\handler-runner\index.js
- D:\path\to\project\node_modules\serverless-offline\dist\lambda\LambdaFunction.js
- D:\path\to\project\node_modules\serverless-offline\dist\lambda\LambdaFunctionPool.js
- D:\path\to\project\node_modules\serverless-offline\dist\lambda\Lambda.js
- D:\path\to\project\node_modules\serverless-offline\dist\lambda\index.js
- D:\path\to\project\node_modules\serverless-offline\dist\ServerlessOffline.js
- D:\path\to\project\node_modules\serverless-offline\dist\index.js
- D:\path\to\project\node_modules\serverless-offline\dist\main.js
- D:\path\to\project\node_modules\serverless\lib\classes\PluginManager.js
- D:\path\to\project\node_modules\serverless\lib\Serverless.js
- D:\path\to\project\node_modules\serverless\scripts\serverless.js
- D:\path\to\project\node_modules\serverless\bin\serverless.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18)
at dB (D:\path\to\project\backend\.esbuild\.build\functions\index.js:38:5768)
at Pr (D:\path\to\project\backend\.esbuild\.build\functions\index.js:38:6144)
at Object.<anonymous> (D:\path\to\project\backend\.esbuild\.build\functions\index.js:38:6888)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18)
at D:\path\to\project\node_modules\serverless-offline\dist\lambda\handler-runner\in-process-runner\InProcessRunner.js:157:133
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async InProcessRunner.run (D:\path\to\project\node_modules\serverless-offline\dist\lambda\handler-runner\in-process-runner\InProcessRunner.js:157:9)
And here my serverless.yml
file
Also I noticed this error when I try invoking the end-point after deployment https://github.com/feryardiant/learn-webar/issues/8
Exclude is different to External, have you tried External like floydspace suggested?
@samchungy yes I have and the result is remain the same
Looks like an issue with knex
we have a closed issue related to knex
https://github.com/floydspace/serverless-esbuild/issues/114
maybe @feryardiant you can find a solution there
Closing. @feryardiant please reopen if you still have an issue
Hi, I am new here and experiencing this issue which is I have no clue what's just happened 😅
My project is using
knex
withpostgres
orsqlite
as main database, but when I ransls offline
and trying to accessing the url, my terminal show me this error.Appreciate any helps, Thank you in advance.
Info