-
-
Notifications
You must be signed in to change notification settings - Fork 118
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
Failed to resolve entry for package "remix-utils". #278
Comments
There’s nothing at remix-utils, each util is a different module. You can see how to import each util individually in the README. |
Recently upgraded to Remix Everything works fine when using relative import paths still getting the same issue after making the changes suggested in this thread: #228 (comment) My file setup below /** @type {import('@remix-run/dev').AppConfig} */
import { config } from "@netlify/remix-adapter";
export default {
serverModuleFormat: "esm",
...config,
ignoredRouteFiles: ["**/.*"],
serverPlatform: "node",
server:
process.env.NETLIFY || process.env.NETLIFY_LOCAL
? "./server.ts"
: undefined,
serverBuildPath: ".netlify/functions-internal/server.js",
postcss: false,
tailwind: true,
serverDependenciesToBundle: [
"@radix-ui/themes",
/^rc-util.*/,
],
};
{
"include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx"],
"compilerOptions": {
"lib": ["DOM", "DOM.Iterable", "ES2019"],
"isolatedModules": true,
"esModuleInterop": true,
"jsx": "react-jsx",
"module": "ES2022",
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"target": "ES2019",
"strict": true,
"allowJs": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
"~/*": ["./app/*"]
},
"noEmit": true
}
}
{
"private": true,
"sideEffects": false,
"type": "module",
"scripts": {
"build": "remix build",
"dev": "yarn run check-env-file && remix dev --manual",
"start": "netlify dev",
"typecheck": "tsc",
"check-env-file": "node ./scripts/check-env-file.mjs",
"postinstall": "prisma generate",
"stripe:listen": "stripe listen --forward-to localhost:3000/webhook",
"format": "prettier --write .",
"lint": "eslint --cache --cache-location ./node_modules/.cache/eslint ."
},
"dependencies": {
"@aws-sdk/client-s3": "^3.363.0",
"@conform-to/react": "^0.9.1",
"@conform-to/zod": "^0.9.1",
"@heroicons/react": "^2.0.18",
"@netlify/functions": "^2.3.0",
"@netlify/remix-adapter": "^2.2.0",
"@prisma/client": "^4.13.0",
"@radix-ui/colors": "^3.0.0",
"@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-select": "^2.0.0",
"@radix-ui/react-switch": "^1.0.3",
"@radix-ui/themes": "^2.0.1",
"@remix-run/css-bundle": "^2.2.0",
"@remix-run/express": "^2.2.0",
"@remix-run/node": "2.2.0",
"@remix-run/react": "2.2.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"cross-env": "^7.0.3",
"dotenv": "^16.0.3",
"isbot": "^3.6.8",
"openai": "^3.2.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"remix-auth": "^3.6.0",
"remix-auth-socials": "^2.0.5",
"remix-utils": "^7.1.0",
"stripe": "^12.3.0",
"tailwind-merge": "^2.0.0",
"zod": "^3.22.4"
},
"devDependencies": {
"@remix-run/dev": "2.2.0",
"@remix-run/eslint-config": "2.2.0",
"@remix-run/serve": "2.2.0",
"@types/eslint": "^8.44.3",
"@types/react": "^18.0.35",
"@types/react-dom": "^18.0.11",
"eslint": "^8.38.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^9.0.0",
"prettier": "^3.0.3",
"prisma": "^4.13.0",
"tailwindcss": "^3.3.3",
"typescript": "^5.3.0",
"zx": "7.0.8"
},
"engines": {
"node": "20.5.0"
}
}
|
@sergiodxa you are right, I forgot to update the paths in the mocks. |
By some miracle my issue just disappeared, didn't do anything special 😅 |
Describe the bug
When I mock
remix-ultils
withvitest
asvi.mock("remix-utils")
, I get the errorError: Failed to resolve entry for package "remix-utils". The package may have incorrect main/module/exports specified in its package.json: Missing "." specifier
Your Example Website or App
codesandbox.io/p/devbox/validated-form-error-forked-kd6m28?file=%2Fsrc%2FApp.test.tsx%3A10%2C1
Steps to Reproduce the Bug or Issue
Open codesandbox and see the terminal errors while running tests.
Expected behavior
There is no error on mocking
remix-utils
Screenshots or Videos
No response
Platform
remix-utils
v. 7.1.0Additional context
No response
The text was updated successfully, but these errors were encountered: