Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: when using memoize in react native #99

Closed
NamVinh opened this issue Apr 6, 2024 · 4 comments
Closed

Error: when using memoize in react native #99

NamVinh opened this issue Apr 6, 2024 · 4 comments

Comments

@NamVinh
Copy link

NamVinh commented Apr 6, 2024

image

As shown above, memoize is missing a field called main in the package.json file, so can the author add a main field similar to the object below?

{
"name": "memoize",
"version": "10.0.0",
"description": "Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input",
"license": "MIT",
"main": "dist",
"repository": "sindresorhus/memoize",
"funding": "https://github.com/sindresorhus/memoize?sponsor=1",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"sideEffects": false,
"engines": {
"node": ">=18"
},
"scripts": {
"test": "xo && ava && npm run build && tsd --typings dist/index.d.ts",
"build": "del-cli dist && tsc",
"prepack": "npm run build"
},
"files": [
"dist"
],
"keywords": [
"memoize",
"function",
"mem",
"memoization",
"cache",
"caching",
"optimize",
"performance",
"ttl",
"expire",
"promise"
],
"dependencies": {
"mimic-function": "^5.0.0"
},
"devDependencies": {
"@sindresorhus/tsconfig": "^5.0.0",
"@types/serialize-javascript": "^5.0.4",
"ava": "^5.3.1",
"del-cli": "^5.1.0",
"delay": "^6.0.0",
"serialize-javascript": "^6.0.1",
"ts-node": "^10.9.1",
"tsd": "^0.29.0",
"xo": "^0.56.0"
},
"ava": {
"timeout": "1m",
"extensions": {
"ts": "module"
},
"nodeArguments": [
"--loader=ts-node/esm"
]
},
"xo": {
"rules": {
"@typescript-eslint/no-unsafe-return": "off"
}
}
}

@fregante
Copy link
Collaborator

fregante commented Apr 6, 2024

This is an issue with your config/environment, not with this package.

https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

@fregante fregante closed this as not planned Won't fix, can't repro, duplicate, stale Apr 6, 2024
@fregante
Copy link
Collaborator

fregante commented Apr 6, 2024

To help you with your search, this is because your configuration doesn't support the package.json exports field

@NamVinh
Copy link
Author

NamVinh commented Apr 6, 2024

This is my tsconfig.json. Can you help me fix it ?

{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "React Native",
"extends": "./base.json",
"compilerOptions": {
"target": "esnext",
"module": "es2015",
"moduleResolution": "bundler",
"types": ["react-native"],
"lib": [
"es2019",
"es2020.bigint",
"es2020.date",
"es2020.number",
"es2020.promise",
"es2020.string",
"es2020.symbol.wellknown",
"es2021.promise",
"es2021.string",
"es2021.weakref",
"es2022.array",
"es2022.object",
"es2022.string"
],
"allowJs": true,
"jsx": "react-native",
"noEmit": true,
"isolatedModules": true,
"strict": true,
"customConditions": ["react-native"],
"allowImportingTsExtensions": true,
"allowArbitraryExtensions": true,
"resolveJsonModule": true,
"resolvePackageJsonImports": false,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": false
},
"exclude": ["node_modules", "babel.config.js", "metro.config.js", "jest.config.js"]
}

@fregante
Copy link
Collaborator

fregante commented Apr 6, 2024

Try stackoverflow or Facebook

Repository owner locked and limited conversation to collaborators Apr 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants