I have just upgraded to the latest version `0.66.3...
# help
j
I have just upgraded to the latest version
0.66.3
and I am getting the following error at runtime
Copy code
Cannot use import statement outside a module
(node:65576) Warning: require() of ES modules is not supported.
require() of /Users/jamieberke/Documents/GitHub/dentr/backend/node_modules/@serverless-stack/aws-lambda-ric/bin/index.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /Users/jamieberke/Documents/GitHub/dentr/backend/node_modules/@serverless-stack/aws-lambda-ric/package.json.
ive tried setting the bundle format to
esm
but no luck
@thdxr
t
Can you delete node modules and reinstall
j
sure
i am now getting this after doing a fresh
npm install
which i think is the same issue
t
if you have esm enabled you have to use
export
syntax
try without esm if you're not ready to do that
f
@Jamie Berke checking in to see if you had a chance to try what @thdxr suggested, and if that works for you.
j
it did thanks guys