getting an error when using `1.2.11` , this may be...
# help
d
getting an error when using
1.2.11
, this may be related to installing SST Resources in a CDK app (rare, but we do this on occasion), I have not been able to replicate this in many places (error in thread). This may also have something to do with having SST as a peerDependency in a library that is installed. These seem to be the only commonalities for the places it occurs. Downgrading to
1.1.1
fixes the issue.
Copy code
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /Users/derekkershner/repos/resonance-infrastructure-foundations/node_modules/@serverless-stack/resources/package.json
    at new NodeError (internal/errors.js:322:7)
    at throwExportsNotFound (internal/modules/esm/resolve.js:322:9)
    at packageExportsResolve (internal/modules/esm/resolve.js:511:7)
    at resolveExports (internal/modules/cjs/loader.js:450:36)
    at Function.Module._findPath (internal/modules/cjs/loader.js:490:31)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:888:27)
    at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue [as _resolveFilename] (/Users/derekkershner/repos/resonance-infrastructure-foundations/node_modules/@cspotcode/source-map-support/source-map-support.js:811:30)
    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) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
FWIW, the file linked does seem to have a
main
field and it is correct and the dist file exists.
No idea why this randomly occurred to be honest, but figured id mention.
s
Getting the same error after upgrading SST from
1.1.1
to
1.2.18
and trying to deploy
d
I never figured out why this occurred, I ended up just removing SST as a peerDependency (and just remembering to always install it, not ideal)
I believe this to be some kind of circular dependency issue not correctly handled either by
npm
or perhaps the SST package itself.