storage: Unable to resolve "@vercel/blob/client"
Using React Native with Expo and ran yarn add @vercel/blob. When I try to do:
import { upload } from "@vercel/blob/client";
const newBlob = await upload(name, buffer....
I get:
Unable to resolve "@vercel/blob/client" from "screens/HomeScreen.tsx"
Version:
"@vercel/blob": "^0.15.1",
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 21 (7 by maintainers)
@sajeeIfonix Can you bring this issue over to the expo repository? Our package.json is correct as per https://arethetypeswrong.github.io/?p=%40vercel%2Fblob%400.22.3 so I suspect something is wrong with expo/expo setup here. It would be awesome to find out what 🙏
Thanks for looking into this. I guess we’ll use AWS S3 until this issue is resolved.
I found if you add:
to your metro config, the bundler can correctly resolve the
@vercel/blob/clientimport. This is needed because@vercel/blobrelies on theexportsfield in the pjson.This leads to a different error for me though where
import * as crypto from "crypto"can’t be resolved. Here it seems like the module resolution is wrong again. It’s trying to import fromnode_modules/@vercel/dist/crypto-browser.jswhere the real path would benode_modules/@vercel/blob/dist/crypto-browser.js.If you also run into this issue it might be worth opening an issue in
expoormetro