I am trying to deploy my express.js app but i keep facing this error
Runtime.UserCodeSyntaxError: SyntaxError: Cannot use import statement outside a module
at _loadUserApp (file:///var/runtime/index.mjs:1084:17)
at async UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1119:21)
at async start (file:///var/runtime/index.mjs:1282:23)
at async file:///var/runtime/index.mjs:1288:1
Netlify internal ID: 01J2YRQH0VQ75DZW1FH3PDDRXN
netlify/functions/server.js:
import serverless from "serverless-http";
import app from "../../index.js";
export const handler = serverless(app);
I dont understand why it happens, my package.json uses "type": "module"
and this is my netlify.toml:
[functions]
node_bundler = "esbuild"
[build]
functions = "netlify/functions"
node_bundler = "esbuild"
[[redirects]]
force = true
from = "/*"
to = "/.netlify/functions/server"
status = 200