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

Fails to compile, cant deploy to Vercel either #225

Open
Kainkainkain opened this issue Dec 20, 2023 · 2 comments · May be fixed by #235
Open

Fails to compile, cant deploy to Vercel either #225

Kainkainkain opened this issue Dec 20, 2023 · 2 comments · May be fixed by #235

Comments

@Kainkainkain
Copy link

It seems to have a problem finding '@medusajs/types'
Indeed if I look at files referring to that, they are red underlined.

run dev works fine.

pnpm run build

[email protected] build
next build

next.config.js {
"experimental": {
"serverComponentsExternalPackages": [
"@medusajs/product",
"@medusajs/modules-sdk"
]
},
"reactStrictMode": true,
"images": {
"remotePatterns": [
{
"protocol": "http",
"hostname": "localhost"
}
]
},
"env": {}
}
▲ Next.js 14.0.4

  • Environments: .env

✓ Creating an optimized production build
✓ Compiled successfully

./src/lib/context/checkout-context.tsx
238:6 Warning: React Hook useEffect has a missing dependency: 'initPayment'. Either include it or remove the dependency array. react-hooks/exhaustive-deps

./src/modules/layout/components/footer-nav/index.tsx
23:16 Warning: Using <img> could result in slower LCP and higher bandwidth. Consider using <Image /> from next/image to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
135:18 Warning: Using <img> could result in slower LCP and higher bandwidth. Consider using <Image /> from next/image to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
135:18 Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text

info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
Linting and checking validity of types ...Failed to compile.

./src/lib/util/filter-products-by-status.ts:1:28
Type error: Cannot find module '@medusajs/types/dist/product/common' or its corresponding type declarations.

1 | import { ProductDTO } from "@medusajs/types/dist/product/common"
| ^
2 |
3 | export default function filterProductsByStatus(
4 | products: ProductDTO[],

@Kainkainkain
Copy link
Author

pnpm i @medusajs/types fixed that issue - but I don't know why it wasn't already in package and why npm dev works.

next issue was same thing- missing package @radix-ui/react-accordion. Also pnpm i @radix-ui/react-accordion to solve.

@dinesh-58 dinesh-58 linked a pull request Jan 9, 2024 that will close this issue
@nino-magazinovic
Copy link

nino-magazinovic commented Apr 6, 2024

Thanks for the pnpm workaround.

Compile with npm works without any additional dependencies but linting fails both on npm and pnpm:

./src/modules/products/components/product-tabs/accordion.tsx:57:8
Type error: Unused '@ts-expect-error' directive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants