I'm on 16.15.1 (on macos) and still getting this o...
# help
w
I'm on 16.15.1 (on macos) and still getting this on
npm start
Copy code
import { Api, Table } from "@serverless-stack/resources";
         ^^^
SyntaxError: Named export 'Api' not found. The requested module '@serverless-stack/resources' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@serverless-stack/resources';
const { Api, Table } = pkg;

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:128:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:194:5)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:385:24)
    at async
m
which version of SST are you using?
w
1.2.27
ok so I copy-pasted the suggested solution
Copy code
import pkg from '@serverless-stack/resources';
const { Api, Table } = pkg;
and it worked
now it says
Copy code
TypeError: app.setDefaultFunctionProps is not a function
    at Module.default
@manitej are you using Mac OS?
m
yes
can you show your stack code?
I don't think I'm doing anything that fancy
I'm using the node runtime installed by brew. Maybe I should try using the one from nvm...
yeah, that was the issue