N
Nuxt5mo ago
u007

readFileSync" is not exported by

pnpm build got this error, any clue? 31.45 ℹ ✓ 8407 modules transformed. 31.46 31.46 ERROR x Build failed in 25.84s 31.46 31.46 31.46 ERROR Nuxt Build Error: server/lib/s3.server.ts (11:9): "readFileSync" is not exported by "__vite-browser-external", imported by "server/lib/s3.server.ts". 31.46 file: /src/movingfwd/server/lib/s3.server.ts:11:9 31.46 31.46 9: import { getSignedUrl as s3GetSignedUrl } from '@aws-sdk/s3-request-presigner' 31.46 10: import AWS from 'aws-sdk' 31.46 11: import { readFileSync } from 'node:fs' 31.46 ^ 31.46 12: import { nodeWithDefaults } from '@/lib/default' 31.46 error on import section:
import type { S3Repo } from '@prisma/client'
// import Spaces from 'digitalocean-spaces'
import {
S3,
PutObjectCommand,
ObjectCannedACL,
type PutObjectCommandInput,
} from '@aws-sdk/client-s3'
import { getSignedUrl as s3GetSignedUrl } from '@aws-sdk/s3-request-presigner'
import AWS from 'aws-sdk'
import { readFileSync } from 'node:fs'
import { nodeWithDefaults } from '@/lib/default'

export const getSignedUrl = async (
...
import type { S3Repo } from '@prisma/client'
// import Spaces from 'digitalocean-spaces'
import {
S3,
PutObjectCommand,
ObjectCannedACL,
type PutObjectCommandInput,
} from '@aws-sdk/client-s3'
import { getSignedUrl as s3GetSignedUrl } from '@aws-sdk/s3-request-presigner'
import AWS from 'aws-sdk'
import { readFileSync } from 'node:fs'
import { nodeWithDefaults } from '@/lib/default'

export const getSignedUrl = async (
...
1 Reply
u007
u007OP5mo ago
doing server and client side rendering on the same framework is extremely unpredictable. for some weird reason, all my #nuxt server ts file starts to render on client side causing import error for fs, url and path. anyone experiencing the same issue? ive to do in function import with await to fix this
Want results from more Discord servers?
Add your server