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 exports is not defined #820

Open
wagnerdavanco opened this issue Sep 3, 2024 · 0 comments
Open

Error exports is not defined #820

wagnerdavanco opened this issue Sep 3, 2024 · 0 comments

Comments

@wagnerdavanco
Copy link

wagnerdavanco commented Sep 3, 2024

node version: 20.11.1

Plataform: Windows

Problem

Im problem import component Card with @material-tailwind/react
Follow the steps below to reproduce

I followed the installation guide and it didn't work
https://www.material-tailwind.com/docs/react/guide/astro

1 Step

npm create astro@latest
npx astro add tailwind
npx astro add react
npm i @material-tailwind/react

2 Step

`const withMT = require("@material-tailwind/react/utils/withMT");

module.exports = withMT({
content: [
"./src//*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}",
"path-to-your-node_modules/@material-tailwind/react/components/
/.{js,ts,jsx,tsx}",
"path-to-your-node_modules/@material-tailwind/react/theme/components/**/
.{js,ts,jsx,tsx}",
],
theme: {
extend: {},
},
plugins: [],
});`

3 Step

`import {
Card,
CardHeader,
CardBody,
CardFooter,
Typography,
Button,
} from "@material-tailwind/react";

export function CardDefault() {
return (


card-image



UI/UX Review Check


The place is close to Barceloneta Beach and bus stop just 2 min by
walk and near to "Naviglio" where you can enjoy the main
night life in Barcelona.



Read More


);
}`

4 Step

call component index.astro

<CardDefault />

##package.json
{ "name": "better-bar", "type": "module", "version": "0.0.1", "scripts": { "dev": "astro dev", "start": "astro dev", "build": "astro check && astro build", "preview": "astro preview", "astro": "astro" }, "dependencies": { "@astrojs/check": "^0.9.3", "@astrojs/react": "^3.6.2", "@astrojs/tailwind": "^5.1.0", "@material-tailwind/react": "^2.1.9", "@types/react": "^18.3.5", "@types/react-dom": "^18.3.0", "astro": "^4.15.2", "react": "^18.3.1", "react-dom": "^18.3.1", "tailwindcss": "^3.4.10", "typescript": "^5.5.4" } }

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

No branches or pull requests

1 participant