#Having issues with "@payloadcms/storage-s3": "^3.31.0"

1 messages · Page 1 of 1 (latest)

molten pawn
#

react: 19, next.js 15.2.3 when visiting /admin page

Everything is on version 3.31.0

getFromImportMap: PayloadComponent not found in importMap {key: "@payloadcms/storage-s3/client#S3ClientUploadHandler"PayloadComponent: "@payloadcms/storage-s3/client#S3ClientUploadHandler"schemaPath: "@payloadcms/storage-s3/client#S3ClientUploadHandler"} "You may need to run the payload generate:importmap command to generate the importMap ahead of runtime.

naive depotBOT
crystal bane
#

Did you try to run the command?

molten pawn
#

After running the command:

payload generate:importmap

node:internal/modules/esm/resolve:275
throw new ERR_MODULE_NOT_FOUND(
^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/fellowdeb/Documents/GitHub.nosync/projectx/collections/Media' imported from /Users/fellowdeb/Documents/GitHub.nosync/projectx/payload.config.ts
at finalizeResolution (node:internal/modules/esm/resolve:275:11)
at moduleResolve (node:internal/modules/esm/resolve:860:10)
at defaultResolve (node:internal/modules/esm/resolve:984:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:685:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:634:25)
at ModuleLoader.getModuleJobForRequire (node:internal/modules/esm/loader:384:53)
at new ModuleJobSync (node:internal/modules/esm/module_job:341:34)
at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:357:11)
at loadESMFromCJS (node:internal/modules/cjs/loader:1385:24)
at Module._compile (node:internal/modules/cjs/loader:1536:5) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///Users/fellowdeb/Documents/GitHub.nosync/projectx/collections/Media'
}

Node.js v22.14.0

#

my payload config:

// storage-adapter-import-placeholder
import { lexicalEditor } from '@payloadcms/richtext-lexical';
import path from 'path';
import { buildConfig } from 'payload';
import { fileURLToPath } from 'url';
import sharp from 'sharp';
import { postgresAdapter } from '@payloadcms/db-postgres';
import { Media } from './collections/Media';
import { Posts } from './collections/Posts';
import { Users } from './collections/Users';
import { s3Storage } from '@payloadcms/storage-s3';
const filename = fileURLToPath(import.meta.url);
const dirname = path.dirname(filename);

export default buildConfig({
admin: {
user: Users.slug,
importMap: {
baseDir: path.resolve(dirname)
}
},
collections: [Users, Media, Posts],
editor: lexicalEditor(),
secret: process.env.PAYLOAD_SECRET || '',
typescript: {
outputFile: path.resolve(dirname, 'payload-types.ts')
},
// database-adapter-config-start
db: postgresAdapter({
schemaName: 'cms',
pool: {
connectionString: process.env.DATABASE_URI || ''
}
}),
// database-adapter-config-end
sharp,
plugins: [
// storage-adapter-placeholder
s3Storage({
collections: {
media: {
prefix: 'media'
}
},
bucket: process.env.S3_BUCKET || '',
config: {
forcePathStyle: true,
credentials: {
accessKeyId: process.env.S3_ACCESS_KEY_ID || '',
secretAccessKey: process.env.S3_SECRET_ACCESS_KEY || ''
},
region: process.env.S3_REGION || '',
endpoint: process.env.S3_ENDPOINT || ''
}
})
]
});

crystal bane
#

Please share your package.json

molten pawn
crystal bane
#

Try removing the lock, node_modules and .next and reinstall the dependencies

molten pawn
#

Will try that now

#

The issue still persists...

molten pawn
#

Aha, seems to be an issue with next --turbo. When running without turbo, it seems to work

bleak shoal
#

same error any solution ?